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
12 changes: 12 additions & 0 deletions patches/backported-patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,17 @@
"patch_path": "patches/web-server/webview.diff",
"link": "https://github.com/microsoft/vscode/commit/236fa7d8ea86f0f4261df38e1a17b3c7e7002bd0",
"note": "webWorkerExtensionHostIframe.html hardening already shipped: in the non-validated hostname path parentOrigin is forced to window.origin and the attacker-supplied parentOrigin search param is never used, equivalent to upstream's explicit parentOrigin rejection"
},
{
"finding_id": "CVE-2026-70334",
"affected_versions": "< 1.136.2",
"patch_path": "patches/common/fix-config-nested-restricted-settings.diff",
"link": "https://github.com/microsoft/vscode/commit/0684cb5905a3f23156f45a28135326e09310ff4d"
},
{
"finding_id": "GHSA-q2f8-hh8x-wpc2",
"affected_versions": "< 1.136.2",
"patch_path": "patches/common/fix-config-nested-restricted-settings.diff",
"link": "https://github.com/microsoft/vscode/commit/0684cb5905a3f23156f45a28135326e09310ff4d"
}
]
74 changes: 74 additions & 0 deletions patches/common/fix-config-nested-restricted-settings.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From: Sandeep Somavarapu <sasomava@microsoft.com>
Subject: Filter restricted settings in nested configuration objects
Origin: backport, https://github.com/microsoft/vscode/commit/0684cb5905a3f23156f45a28135326e09310ff4d
Bug: GHSA-q2f8-hh8x-wpc2

ConfigurationModelParser only checked top-level keys against the
configuration registry. Walk nested objects and check each setting by its
effective dotted path. Adapted for 1.101.x, which has no excluded-property
filtering in the parser. Remove when Code-OSS is updated to >= 1.136.2.
Index: code-editor-src/src/vs/platform/configuration/common/configurationModels.ts
===================================================================
--- code-editor-src.orig/src/vs/platform/configuration/common/configurationModels.ts
+++ code-editor-src/src/vs/platform/configuration/common/configurationModels.ts
@@ -428,12 +428,11 @@ export class ConfigurationModelParser {
hasExcludedProperties = hasExcludedProperties || result.hasExcludedProperties;
restricted.push(...result.restricted);
} else {
- const propertySchema = configurationProperties[key];
- if (propertySchema?.restricted) {
- restricted.push(key);
- }
- if (this.shouldInclude(key, propertySchema, options)) {
- raw[key] = properties[key];
+ const result = this.filterProperty(key, properties[key], configurationProperties, options);
+ restricted.push(...result.restricted);
+ hasExcludedProperties = hasExcludedProperties || result.hasExcludedProperties;
+ if (result.included) {
+ raw[key] = result.value;
} else {
hasExcludedProperties = true;
}
@@ -442,6 +441,42 @@ export class ConfigurationModelParser {
return { raw, restricted, hasExcludedProperties };
}

+ private filterProperty(path: string, value: unknown, configurationProperties: { [qualifiedKey: string]: IConfigurationPropertySchema | undefined }, options: ConfigurationParseOptions): { included: boolean; value: unknown; restricted: string[]; hasExcludedProperties: boolean } {
+ const propertySchema = configurationProperties[path];
+ if (propertySchema) {
+ return { included: this.shouldInclude(path, propertySchema, options), value, restricted: propertySchema.restricted ? [path] : [], hasExcludedProperties: false };
+ }
+ if (!types.isObject(value) || Array.isArray(value)) {
+ return { included: this.shouldInclude(path, propertySchema, options), value, restricted: [], hasExcludedProperties: false };
+ }
+ // If the whole object is explicitly excluded, do not recurse into its children.
+ if (options.exclude?.includes(path)) {
+ return { included: false, value, restricted: [], hasExcludedProperties: false };
+ }
+ const keys = Object.keys(value);
+ if (keys.length === 0) {
+ return { included: this.shouldInclude(path, propertySchema, options), value, restricted: [], hasExcludedProperties: false };
+ }
+ const nested: IStringDictionary<unknown> = {};
+ const restricted: string[] = [];
+ let included = false;
+ let hasExcludedProperties = false;
+ for (const key of keys) {
+ const result = this.filterProperty(`${path}.${key}`, (value as IStringDictionary<unknown>)[key], configurationProperties, options);
+ if (result.restricted.length) {
+ restricted.push(...result.restricted);
+ }
+ hasExcludedProperties = hasExcludedProperties || result.hasExcludedProperties;
+ if (result.included) {
+ nested[key] = result.value;
+ included = true;
+ } else {
+ hasExcludedProperties = true;
+ }
+ }
+ return { included, value: nested, restricted, hasExcludedProperties };
+ }
+
private shouldInclude(key: string, propertySchema: IConfigurationPropertySchema | undefined, options: ConfigurationParseOptions): boolean {
if (options.exclude?.includes(key)) {
return false;
1 change: 1 addition & 0 deletions patches/sagemaker.series
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ sagemaker/remove-delay-shutdown-endpoint.diff
common/finding-override-undici.diff
common/finding-override-ws.diff
common/finding-override-tar.diff
common/fix-config-nested-restricted-settings.diff
1 change: 1 addition & 0 deletions patches/web-embedded-with-terminal.series
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,4 @@ web-embedded/only-allow-trusted-origins-in-webviews.diff
common/finding-override-undici.diff
common/finding-override-ws.diff
common/finding-override-tar.diff
common/fix-config-nested-restricted-settings.diff
1 change: 1 addition & 0 deletions patches/web-embedded.series
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ web-embedded/enable-ts-features.diff
common/finding-override-undici.diff
common/finding-override-ws.diff
common/finding-override-tar.diff
common/fix-config-nested-restricted-settings.diff
1 change: 1 addition & 0 deletions patches/web-server.series
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ web-server/signature-verification.diff
common/finding-override-undici.diff
common/finding-override-ws.diff
common/finding-override-tar.diff
common/fix-config-nested-restricted-settings.diff
Loading