phpLDAPadmin icon indicating copy to clipboard operation
phpLDAPadmin copied to clipboard

XSS from CVE-2020-35132 (#130) still unfixed

Open epozuelo opened this issue 4 years ago • 2 comments

I was able to reproduce the issue reported in #130 with 1.2.6.2, the version that supposedly fixed that bug. Thus I believe the fix was incomplete and phpLDAPadmin is still vulnerable to that XSS.

The steps to reproduce are the same as outlined in https://github.com/leenooks/phpLDAPadmin/issues/130#issue-754474648

epozuelo avatar Feb 24 '21 10:02 epozuelo

I believe this line in lib/PageRender.php needs to be fixed as well. The old value must be escaped with htmlspecialchars too. After that I cannot reproduce the XSS exploit anymore.

https://github.com/leenooks/phpLDAPadmin/blob/a4924f7453254366403f11108ebc16f03037b750/lib/PageRender.php#L559

apoleon avatar Oct 25 '21 09:10 apoleon

@leenooks any news on this issue?

carnil avatar Jan 27 '22 20:01 carnil

@leenooks any update on the status for this issue?

carnil avatar Mar 18 '23 13:03 carnil

@leenooks any update on the status for this issue?

I reproduced this XSS on the Update page, with the previous value already containing the XSS payload. See steps: https://github.com/leenooks/phpLDAPadmin/issues/130#issue-754474648

williamdes avatar Mar 18 '23 17:03 williamdes

https://github.com/leenooks/phpLDAPadmin/issues/137#issuecomment-950691115

Fix:

diff --git a/lib/PageRender.php b/lib/PageRender.php
index d905c96..b0682bf 100644
--- a/lib/PageRender.php
+++ b/lib/PageRender.php
@@ -556,7 +556,7 @@ class PageRender extends Visitor {
        final protected function drawOldValueAttribute($attribute,$i) {
                if (DEBUGTMP) printf('<font size=-2>%s</font><br />',__METHOD__);
 
-               echo $attribute->getOldValue($i);
+               echo htmlspecialchars($attribute->getOldValue($i));
        }
 
        /** DRAW DISPLAYED CURRENT VALUES **/

williamdes avatar Mar 18 '23 18:03 williamdes

PR done in: https://github.com/leenooks/phpLDAPadmin/pull/201

williamdes avatar Mar 31 '23 10:03 williamdes

Released as 1.2.6.6 🎉

williamdes avatar Apr 01 '23 14:04 williamdes