Skip to content

πŸ›‘οΈ Sentinel: [HIGH] Fix Path Traversal in LeaseFileLockingService - #141

Merged
tomdesair merged 2 commits into
masterfrom
bugfix/sentinel-path-traversal-leasefile-11616360575913462100
Sep 29, 2026
Merged

tomdesair merged 2 commits into
masterfrom
bugfix/sentinel-path-traversal-leasefile-11616360575913462100

Conversation

@tomdesair

Copy link
Copy Markdown
Owner

🚨 Severity: HIGH
πŸ’‘ Vulnerability: A Path Traversal vulnerability was identified in LeaseFileLockingService and LeaseFileMutex. These classes resolved UploadId directly against the storagePath to generate .lock, .stop, and .mutex files, which means an attacker could provide a malicious UploadId containing traversal characters (like ../../../) to access or modify files outside the intended storage directory.
🎯 Impact: This could allow attackers to manipulate or corrupt arbitrary files on the server (like ../../../tmp/malicious.lock), potentially leading to unauthorized access, denial of service, or further exploitation.
πŸ”§ Fix: Implemented validation checks in getLockDirPath, getStopFilePath (in LeaseFileLockingService), and the constructor of LeaseFileMutex. The fix uses path.normalize().toAbsolutePath().startsWith(storagePath.normalize().toAbsolutePath()) to strictly verify that the generated paths are bounded within the designated storagePath.
βœ… Verification: Ensure the unit tests pass (mvn test). Also ran mvn checkstyle:check and format tools.


PR created automatically by Jules for task 11616360575913462100 started by @tomdesair

Co-authored-by: tomdesair <14034630+tomdesair@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

πŸ‘‹ 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

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: tomdesair <14034630+tomdesair@users.noreply.github.com>
@coveralls

coveralls commented Sep 29, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 94.834% (-0.05%) from 94.885% β€” bugfix/sentinel-path-traversal-leasefile-11616360575913462100 into master

@tomdesair
tomdesair merged commit c3aa27f into master Sep 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants