π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in Auth Files API#102
π‘οΈ Sentinel: [CRITICAL] Fix Path Traversal in Auth Files API#102
Conversation
Co-authored-by: rschumann <360788+rschumann@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Co-authored-by: rschumann <360788+rschumann@users.noreply.github.com>
π¨ Severity: CRITICAL
π‘ Vulnerability: Cross-platform path traversal vulnerability. The
UploadAuthFileandDeleteAuthFileAPIs relied onstrings.Contains(name, string(os.PathSeparator))to sanitize filenames. On Windows,os.PathSeparatoris\meaning/is permitted, allowing an attacker to supply a payload like../../secrets/file.jsonand traverse directories. InUploadAuthFile,file.Filenamewasn't explicitly verified.π― Impact: Malicious actors could delete or replace arbitrary
.jsonfiles outside the designatedAuthDirdirectory on Windows hosts if the API relies on local paths, potentially compromising internal keys and data or triggering Denial of Service (DoS) by wiping configuration.π§ Fix: Replaced
strings.Containswithstrings.ContainsAny(name, "/\\")for both queries and form payloads. Validatesfile.Filenameexplicitly alongside the query params.β Verification: Verified by existing security unit tests (
auth_files_security_test.go) and standardgo test ./... -shortwhich are confirmed to pass properly with this security check.PR created automatically by Jules for task 8781413356012186276 started by @rschumann