Lucene search

K
huntrTsarsecurity93F981A3-231D-460D-A239-BB960E8C2FDC
HistoryFeb 16, 2023 - 1:37 a.m.

Stored XSS in the adminlog functionality.

2023-02-1601:37:04
tsarsecurity
www.huntr.dev
8
stored xss
adminlog
unsanitized input
phpmyfaq
admin user
bug bounty

0.001 Low

EPSS

Percentile

23.5%

Description

There is a stored XSS in the ‘adminlog’ functionality. E.g. the page http://phpmyfaq.local/admin/?action=adminlog shows (failed) login attempts. If a user with the username ‘<script>alert(1);</script>’ tries to log in, it gets logged and displayed on the adminlog unsanitized.

Proof of Concept

  1. visit http://phpmyfaq.tld/admin/index.php and try to login with &lt;script&gt;alert(1);&lt;/script&gt;

after the failed login attempt, visit

You will notice the script tags being injected:

Invalid user or password.\nLogin: &lt;script&gt;alert(1);&lt;/script&gt;\nErrors: Specified login could not be found. 

Fix

sanitize $loggingValue[‘text’] in https://github.com/thorsten/phpMyFAQ/blob/5bd0f79d085feb255d893a67d2fcdac51f4cd2ec/phpmyfaq/admin/stat.adminlog.php#L123 before serving it to the admin user.

0.001 Low

EPSS

Percentile

23.5%

Related for 93F981A3-231D-460D-A239-BB960E8C2FDC