Skip to content

#3318 Improve validation of forwarded attachment file paths - #3319

Merged
sosnovsky merged 6 commits into
masterfrom
issue-3318-forwarded-attachment-path-validation
Nov 5, 2026
Merged

sosnovsky merged 6 commits into
masterfrom
issue-3318-forwarded-attachment-path-validation

Conversation

@martgil

@martgil martgil commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

This PR confines forwarded attachment downloads to their cache directory.

Closes #3318


Tests (delete all except exactly one):

  • Tests added or updated

To be filled by reviewers

I have reviewed that this PR... (tick whichever items you personally focused on during this review):

  • addresses the issue it closes (if any)
  • code is readable and understandable
  • is accompanied with tests, or tests are not needed
  • is free of vulnerabilities

@martgil
martgil force-pushed the issue-3318-forwarded-attachment-path-validation branch from a410bc9 to e055797 Compare October 23, 2026 11:22
@DenBond7 DenBond7 mentioned this pull request Nov 4, 2026
5 tasks

@DenBond7 DenBond7 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@martgil Thanks, the fix looks good 👍 . I pushed two test commits on top:

  • a Robolectric test for DownloadForwardedAttachmentsWorker.loadAttachments that checks a traversal name is rejected before any file operation. It fails on the old code.
  • the symlink and sibling-prefix tests in GetFileInsideDirTest used names with /, so they were rejected by the separator check before reaching the canonical-path checks. They now go through a symlink instead.

No further changes needed from my side. @sosnovsky Please review our changes.

@sosnovsky sosnovsky left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well done 👍

@sosnovsky
sosnovsky merged commit 9528243 into master Nov 5, 2026
8 checks passed
@sosnovsky
sosnovsky deleted the issue-3318-forwarded-attachment-path-validation branch November 5, 2026 14:08
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.

Improve validation of forwarded attachment file paths

3 participants