Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/app/lib/personal-kits/proposal-path-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const LOCAL_PATHS: ReadonlyArray<RegExp> = [
/\b(?:file|smb):[\\/]/i,
// An editor or IDE link to a file: vscode://file/..., cursor://file/...
/\b[a-z][a-z0-9+.-]{0,31}:(?:\\*\/){2}file[\\/:]/i,
// A user home on the remote side of an ssh or sftp URL (ssh://kai@devbox/home/kai).
// A user home on the remote side of an ssh or sftp URL (ssh://kai@devbox/home/alice).
/\b(?:ssh|sftp|scp|git\+ssh|svn\+ssh):(?:\\*\/){2}[^\s/\\"'<>`]*(?:\\*\/)+(?:home|Users|root)(?![A-Za-z0-9_-])/i,
// A bare user, temp, mount or volume root, after any non-path character (also `\/home`).
new RegExp(String.raw`${START}${SEP}(?:home|Users|root|mnt|media|Volumes|var${SEP}folders|tmp|private|run${SEP}user)(?![\p{L}\p{N}_-])`, "iu"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ describe("detector cost on hostile input", () => {
});

it("still finds a path or secret at the end of a hostile run", () => {
expect(hasLocalPath(fill("/") + "home/kai")).toBe(true);
expect(hasLocalPath(fill("/") + "home/alice")).toBe(true);
expect(hasLocalPath(fill("a-") + " /srv/x/y")).toBe(true);
expect(genericSecrets(fill("eyJ-") + " " + ["eyJ", "hbGciOiJIUzI1NiJ9", ".eyJ", "zdWIiOiIxIn0", ".c2ln"].join(""))).toEqual(["secret-jwt"]);
});
Expand Down
38 changes: 19 additions & 19 deletions packages/contracts/src/fixtures/kit-proposal-policy-vectors-v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,15 +394,15 @@
"d:/data/file",
"share \\\\srv01\\public\\x",
"\"\\\\\\\\srv01\\\\share\\\\x\"",
"file:///home/kai/x",
"file:///home/alice/x",
"file://host/share",
"/mnt/c/Users/kai",
">/home/kai/log",
"</home/kai",
">/home/alice/log",
"</home/alice",
"{/Users/kai}",
"|/home/kai",
";/home/kai",
"*/home/kai",
"|/home/alice",
";/home/alice",
"*/home/alice",
"/Volumes/Data/x",
"/var/folders/ab/T/x",
"see /tmp/build",
Expand Down Expand Up @@ -432,37 +432,37 @@
"%5C%5Chost%5Cshare",
"C%3A%5CUsers%5Ckai",
"%252Fhome%252Fkai",
"/usr/bin/../../home/kai",
"/usr/bin/../../home/alice",
"/etc/../srv/x",
"/dev/sda1/x",
"/dev/null/x",
"-I/opt/acme/include",
"cc -I/home/kai/src x.c",
"cc -I/home/alice/src x.c",
"-isystem/opt/x/include",
"--include=/opt/x",
"-L/srv/lib",
"vscode://file/home/kai/x.ts",
"vscode://file/home/alice/x.ts",
"vscode-insiders://file/c:/Users/kai/x",
"cursor://file/Users/kai/x",
"[x](vscode://file/srv/app/a.ts:3)",
"idea://open?file=/home/kai/x",
"idea://open?file=/home/alice/x",
"zed://file/opt/acme/x",
"/Usuários/kai/x",
"/Пользователи/kai",
"/données/x",
"/usr/home/kai",
"/usr/home/alice",
"/USR/HOME/kai",
"/usr/local/acme-internal/bin",
"%2Fusr%2Fhome%2Fkai",
"\"\\/usr\\/home\\/kai\"",
"/usr/local/acme/x",
"////////////////////////////////////////home/kai",
"////////////////////////////////////////home/alice",
"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\srv01\\share\\x",
"x \\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/\\/srv/x",
"chrome-extension://abc/home/kai",
"chrome-extension://abc/home/alice",
"/usr/src/app/config/prod.yml",
"/usr/src/acme-internal/.env",
"/proc/self/root/home/kai/.ssh/id_rsa",
"/proc/self/root/home/alice/.ssh/id_rsa",
"/proc/1/cwd/x",
"/proc/self/cwd",
"/proc/1/root",
Expand All @@ -474,23 +474,23 @@
"/usr/local/etc/acme/x",
"/usr/local/opt/acme",
"/usr/local/opt/node",
"/usr/bin/%2e%2e/%2e%2e/home/kai/.ssh",
"/usr/bin/%2e%2e/%2e%2e/home/alice/.ssh",
"/usr/bin/%252e%252e/%252e%252e/srv/x",
"/​home/kai",
"/​home/alice",
"/ho‍me/kai",
"/Données/x",
"/usr/bin/⁠../../srv/x",
"https://x.io),/home/kai/x",
"https://x.io),/home/alice/x",
"https://a.b/c,/Users/kai/x",
"[doc](https://a.b/c]/srv/x",
"ssh://kai@devbox/home/kai/work",
"ssh://kai@devbox/home/alice/work",
"sftp://host/Users/kai/x",
"git+ssh://git@host/home/git/repo.git",
"/home/kai/.ssh",
"∕srv∕acme∕x",
"⁄opt⁄acme⁄x",
"C:\Users\kai",
"/usr/bin/%25252e%25252e/home/kai/.ssh",
"/usr/bin/%25252e%25252e/home/alice/.ssh",
"/usr/bin/%2525252e%2525252e/srv/x",
"https://x.io;/srv/acme-internal/x",
"https://x.io|/opt/acme/secret.yml",
Expand Down
Loading