Skip to content
Draft
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: 2 additions & 0 deletions security/jsLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type { CompartmentOptions } from 'ses';
import { mkdirSync, readFileSync, writeFileSync, unlinkSync, openSync, closeSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { EventEmitter } from 'node:events';
import * as process from 'node:process';

type Lockdown = 'none' | 'freeze' | 'ses';
const APPLICATIONS_LOCKDOWN: Lockdown = env.get(CONFIG_PARAMS.APPLICATIONS_LOCKDOWN);
Expand Down Expand Up @@ -83,6 +84,7 @@ export async function scopedImport(filePath: string | URL, scope?: ApplicationSc
Object.freeze(Intrinsic.prototype);
}
Object.freeze(Function);
process.mainModule = undefined; // this has dangerous privileges that should not be accessed
}
}
const moduleUrl = (filePath instanceof URL ? filePath : pathToFileURL(filePath)).toString();
Expand Down
Loading