mirror of
https://github.com/penpot/penpot.git
synced 2026-11-05 01:20:38 +00:00
* 🐛 Confine upload paths to temp dirs Reject upload maps whose path leaves the server temp dirs. Transit bodies can forge a Path such as /etc/passwd and the handlers open it directly. Centralize the realpath prefix check in media validation and apply it to all nine upload fields. Legit multipart files under /tmp/undertow/ or /tmp/penpot/ still pass. AI-assisted-by: muse-spark-1.3-contributor * ♻️ Rename upload validators to check-* Drop the validate prefix and the bang from the media validation helpers for a consistent check naming. Move the temp dir confinement into validation and cover all nine upload fields. Add unit tests for each helper. AI-assisted-by: muse-spark-1.3-contributor * 🐛 Fix svg upload tests to use penpot tmp dir SVG upload tests wrote tempfiles to the system tmp dir, outside the allowed upload prefixes, so check-upload-path rejected them. Point write-temp-svg at /tmp/penpot like the other upload tests. AI-assisted-by: muse-spark-1.3-contributor