File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -186,11 +186,17 @@ function loadManifestTree(rootManifestPath: string): {
186186 areas . push ( { area, manifest : sub } )
187187 }
188188
189- // Null-prototype objects prevent prototype-pollution via untrusted
190- // manifest keys. Object.create(null) + a plain-object cast works
191- // under both relaxed and strict (exactOptionalPropertyTypes) tsconfigs.
192- const mergedUpstreams = Object . create ( null ) as Record < string , Upstream >
193- const mergedSites = Object . create ( null ) as Record < string , Site >
189+ // Null-prototype maps guard against prototype pollution via untrusted
190+ // manifest keys. Double-cast through `unknown` so the
191+ // `exactOptionalPropertyTypes + noUncheckedIndexedAccess` strict
192+ // tsconfig in some repos accepts the `__proto__` sigil.
193+ const mergedUpstreams : Record < string , Upstream > = {
194+ __proto__ : null ,
195+ } as unknown as Record < string , Upstream >
196+ const mergedSites : Record < string , Site > = {
197+ __proto__ : null ,
198+ } as unknown as Record < string , Site >
199+
194200 const mergedRows : Row [ ] = [ ]
195201 // Include order, root last so it wins on duplicate keys.
196202 for ( const { manifest } of [ ...areas . slice ( 1 ) , ...areas . slice ( 0 , 1 ) ] ) {
You can’t perform that action at this time.
0 commit comments