Skip to content

Commit 3f1b341

Browse files
authored
chore: patch security findings (shell-quote override + GHSA backports) (#242)
1 parent a0e6e64 commit 3f1b341

15 files changed

Lines changed: 563 additions & 17 deletions

‎package-lock-overrides/sagemaker.series/package-lock.json‎

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock-overrides/web-embedded-with-terminal.series/package-lock.json‎

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock-overrides/web-embedded.series/package-lock.json‎

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package-lock-overrides/web-server.series/package-lock.json‎

Lines changed: 11 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎patches/backported-patches.json‎

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
"patch_path": "common/fix-terminal-autoreplies.diff",
1212
"link": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-21523"
1313
},
14+
{
15+
"finding_id": "CVE-2026-21518",
16+
"affected_versions": "<1.109.1",
17+
"patch_path": "common/fix-mcp-workspace-trust.diff",
18+
"link": "https://msrc.microsoft.com/update-guide/vulnerability/CVE-2026-21518"
19+
},
1420
{
1521
"finding_id": "CVE-2026-41613",
1622
"affected_versions": "<1.119.1",
@@ -36,5 +42,29 @@
3642
"patch_path": "N/A",
3743
"link": "https://github.com/microsoft/vscode/security/advisories/GHSA-rg3f-8xq5-hwh6",
3844
"note": "Copilot extension not present in Code-OSS 1.108.2"
45+
},
46+
{
47+
"finding_id": "GHSA-credential-provider-host-match",
48+
"affected_versions": "<1.123.1",
49+
"patch_path": "common/fix-github-credential-provider-host-match.diff",
50+
"link": "https://github.com/microsoft/vscode/commit/4b6e2467dbd828018d602f73cc25d1b11f699d2c"
51+
},
52+
{
53+
"finding_id": "GHSA-extpath-is-equal-or-parent",
54+
"affected_versions": "<1.123.1",
55+
"patch_path": "common/fix-extpath-is-equal-or-parent.diff",
56+
"link": "https://github.com/microsoft/vscode/commit/0f1ba1ea103757f3023cc1f9c3eb7327c3ec4b02"
57+
},
58+
{
59+
"finding_id": "GHSA-snippets-path-traversal",
60+
"affected_versions": "<1.123.1",
61+
"patch_path": "common/fix-snippets-path-traversal.diff",
62+
"link": "https://github.com/microsoft/vscode/commit/9b31ff896671125cbfc65f33731c4a99660d6201"
63+
},
64+
{
65+
"finding_id": "GHSA-remote-hosts-loopback",
66+
"affected_versions": "<1.123.1",
67+
"patch_path": "common/fix-remote-hosts-loopback-check.diff",
68+
"link": "https://github.com/microsoft/vscode/commit/9505d0fca49eadb707c450d18dcb41a46b720a9e"
3969
}
40-
]
70+
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Override shell-quote to ^1.8.4.
2+
Regenerate: npx ts-node build-tools/apply-finding-overrides/apply-finding-overrides.ts apply --patch common/finding-override-shell-quote.diff --override global:shell-quote=^1.8.4
3+
Remove when upstream Code-OSS updates shell-quote to >= 1.8.4.
4+
5+
@generated
6+
@generator: npx ts-node build-tools/apply-finding-overrides/apply-finding-overrides.ts apply --patch common/finding-override-shell-quote.diff --override global:shell-quote=^1.8.4
7+
@override-package: shell-quote@^1.8.4
8+
9+
Index: b/package.json
10+
===================================================================
11+
--- a/package.json
12+
+++ b/package.json
13+
@@ -243,7 +243,8 @@
14+
"picomatch": "^2.3.2",
15+
"follow-redirects": "^1.16.0",
16+
"uuid": "^14.0.0",
17+
- "ip-address": "^10.1.1"
18+
+ "ip-address": "^10.1.1",
19+
+ "shell-quote": "^1.8.4"
20+
},
21+
"repository": {
22+
"type": "git",
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Backport extpath isEqualOrParent path traversal normalization from upstream.
2+
Normalizes paths containing '..' segments before comparison to prevent
3+
path traversal attacks via isEqualOrParent checks.
4+
Remove when Code-OSS is updated to >= 1.123.1.
5+
6+
@backported: https://github.com/microsoft/vscode/commit/0f1ba1ea103757f3023cc1f9c3eb7327c3ec4b02
7+
@finding-id: GHSA-extpath-is-equal-or-parent
8+
Index: b/src/vs/base/common/extpath.ts
9+
===================================================================
10+
--- a/src/vs/base/common/extpath.ts
11+
+++ b/src/vs/base/common/extpath.ts
12+
@@ -224,7 +224,9 @@ export function isEqual(pathA: string, p
13+
* you are in a context without services, consider to pass down the `extUri` from the
14+
* outside, or use `extUriBiasedIgnorePathCase` if you know what you are doing.
15+
*/
16+
-export function isEqualOrParent(base: string, parentCandidate: string, ignoreCase?: boolean, separator = sep): boolean {
17+
+export function isEqualOrParent(base: string, parentCandidate: string, ignoreCase?: boolean, forcePosixSemantics = false): boolean {
18+
+ const separator = forcePosixSemantics ? posix.sep : sep;
19+
+
20+
if (base === parentCandidate) {
21+
return true;
22+
}
23+
@@ -233,6 +235,14 @@ export function isEqualOrParent(base: st
24+
return false;
25+
}
26+
27+
+ if (
28+
+ base.indexOf('..') >= 0 ||
29+
+ parentCandidate.indexOf('..') >= 0
30+
+ ) {
31+
+ base = forcePosixSemantics ? posix.normalize(base) : normalize(base);
32+
+ parentCandidate = forcePosixSemantics ? posix.normalize(parentCandidate) : normalize(parentCandidate);
33+
+ }
34+
+
35+
if (parentCandidate.length > base.length) {
36+
return false;
37+
}
38+
Index: b/src/vs/base/common/resources.ts
39+
===================================================================
40+
--- a/src/vs/base/common/resources.ts
41+
+++ b/src/vs/base/common/resources.ts
42+
@@ -174,7 +174,7 @@ export class ExtUri implements IExtUri {
43+
return extpath.isEqualOrParent(originalFSPath(base), originalFSPath(parentCandidate), this._ignorePathCasing(base)) && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);
44+
}
45+
if (isEqualAuthority(base.authority, parentCandidate.authority)) {
46+
- return extpath.isEqualOrParent(base.path, parentCandidate.path, this._ignorePathCasing(base), '/') && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);
47+
+ return extpath.isEqualOrParent(base.path, parentCandidate.path, this._ignorePathCasing(base), true) && base.query === parentCandidate.query && (ignoreFragment || base.fragment === parentCandidate.fragment);
48+
}
49+
}
50+
return false;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Backport GitHub credential provider host matching fix from upstream Code-OSS.
2+
Use exact hostname comparison instead of regex to prevent subdomain spoofing.
3+
Remove when Code-OSS is updated to >= 1.123.1.
4+
5+
@backported: https://github.com/microsoft/vscode/commit/4b6e2467dbd828018d602f73cc25d1b11f699d2c
6+
@finding-id: GHSA-credential-provider-host-match
7+
Index: b/extensions/github/src/credentialProvider.ts
8+
===================================================================
9+
--- a/extensions/github/src/credentialProvider.ts
10+
+++ b/extensions/github/src/credentialProvider.ts
11+
@@ -12,7 +12,8 @@ const EmptyDisposable: Disposable = { di
12+
class GitHubCredentialProvider implements CredentialsProvider {
13+
14+
async getCredentials(host: Uri): Promise<Credentials | undefined> {
15+
- if (!/github\.com/i.test(host.authority)) {
16+
+ const hostname = host.authority.replace(/:\d+$/, '').toLowerCase();
17+
+ if (hostname !== 'github.com') {
18+
return;
19+
}
20+

0 commit comments

Comments
 (0)