Skip to content

Reject record file names pointing outside the file repository - #214

Merged
SteRiccio merged 2 commits into
masterfrom
fix/record-file-path-traversal
Nov 10, 2026
Merged

SteRiccio merged 2 commits into
masterfrom
fix/record-file-path-traversal

Conversation

@SteRiccio

Copy link
Copy Markdown
Member

File attribute values store a file name that comes from record data (sent by the client or read from imported files). It was joined to the record file repository folder as-is, so a name containing ../ could point outside the repository (download, delete, backup).

  • RecordFileManager now resolves repository files through one method that accepts only plain file names (no path separators, . or ..).
  • File names reused during restore must also be plain names, otherwise a new name is generated.

Test: new RecordFileManagerTest.

File attribute names come from record data (sent by the client or read
from imported files) and were joined to the repository folder as-is,
allowing '../' sequences to read or delete arbitrary files.
@sonarqubecloud

Copy link
Copy Markdown

@SteRiccio
SteRiccio merged commit a2c379e into master Nov 10, 2026
3 checks passed
@SteRiccio
SteRiccio deleted the fix/record-file-path-traversal branch November 10, 2026 12:20
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.

1 participant