JamesHeinrich / getID3

http://www.getid3.org/
Other
1.15k stars 245 forks source link

[Security] XSS in demos/demo.mysqli.php of getID 3 #341

Closed seongil-wi closed 3 years ago

seongil-wi commented 3 years ago

Describe the bug Reflected Cross-Site Scripting (XSS) may allow an attacker to execute JavaScript code in the context of the victim’s browser. This may lead to unauthorised actions being performed, unauthorised access to data, stealing of session information, denial of service, etc. An attacker needs to coerce a user into visiting a link with the XSS payload to be properly exploited against a victim.

To Reproduce Steps to reproduce the behavior:

  1. Access to the following link: http://[localhost]/getID3/demos/demo.mysqli.php?encoderoptionsdistribution=1&showtagfiles=%3Cscript%3Ealert(1)%3C/script%3E
  2. Boom!

Where the Issue Occurred The code below displays the user-controlled parameter showtagfiles without sufficient sanitization: https://github.com/JamesHeinrich/getID3/blob/4e02ed09c081a606c734c6b27d1b504fecfe402f/demos/demo.mysqli.php#L1500

StudioMaX commented 3 years ago

Well, besides this XSS, there are a lot of other weird problems in the demo files. Therefore, they are disabled by default. https://github.com/JamesHeinrich/getID3/blob/4e02ed09c081a606c734c6b27d1b504fecfe402f/demos/demo.mysqli.php#L15 But in any case, this will be fixed in #342. Thanks!