-
Notifications
You must be signed in to change notification settings - Fork 0
[WRONG BRANCH] fix(lab): reject POSIX file URIs #243
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -191,6 +191,8 @@ test("event privacy admission rejects raw POSIX path bypass forms", () => { | |||||||||||
| "cwd=/home/@alice", | ||||||||||||
| "cwd=/home/josé/work", | ||||||||||||
| "x-/home/alice", | ||||||||||||
| "detail=file:///etc/passwd", | ||||||||||||
| "detail=file:///home/alice/secret.txt", | ||||||||||||
|
Comment on lines
+194
to
+195
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Add a mixed-case The current values are lowercase, so they verify rejection but not case-insensitive matching. If the As per path instructions, the focused regression test should cover the behavior changed in Proposed test addition "detail=file:///etc/passwd",
"detail=file:///home/alice/secret.txt",
+ "detail=FiLe:///etc/passwd",📝 Committable suggestion
Suggested change
🤖 Prompt for AI AgentsSource: Path instructions |
||||||||||||
| ]) { | ||||||||||||
| try { | ||||||||||||
| enforceEventStructureLimits({ detail }); | ||||||||||||
|
|
||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an event contains a URI such as
file://localhost/home/alice/secret.txt, this expression does not match because it requires the path's third slash immediately afterfile://, whileRAW_POSIX_PATH_REalso skips the slashes following an authority. The URL API normalizes this standard local-file form tofile:///home/alice/secret.txt, butenforceEventStructureLimitsaccepts it, so an unsanitized event can still persist the same sensitive local path through the ledger backstop. Match local file URIs with either an empty orlocalhostauthority and add the authority form to the focused regression cases.Useful? React with 👍 / 👎.