Skip to content

Commit

Permalink
Fix possible prototype pollution
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati365 committed Aug 19, 2024
1 parent 4f875e5 commit 0d9e71a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cdn/combineCKCdnBundlesPacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ export const combineCKCdnBundlesPacks = <P extends CKCdnBundlesPacks>( packs: P

// Map all exports into one big object.
getExportedEntries: async () => {
const exportedGlobalVariables: Record<string, unknown> = {};
// Use Object.create() to create an object without a prototype to avoid prototype pollution.
const exportedGlobalVariables: Record<string, unknown> = Object.create( {} );

// It can be done sequentially because scripts *should* be loaded at this point and the whole execution should be quite fast.
for ( const [ name, pack ] of Object.entries( packs ) ) {
Expand Down

0 comments on commit 0d9e71a

Please sign in to comment.