🐛 Improve expression security

This commit is contained in:
Jan Oberhauser 2021-11-10 08:49:45 +01:00
parent 653a8bb42e
commit e8133d80f8

View file

@ -99,6 +99,19 @@ export class Expression {
);
const data = dataProxy.getDataProxy();
// Support only a subset of process properties
// @ts-ignore
data.process = {
arch: process.arch,
env: process.env,
platform: process.platform,
pid: process.pid,
ppid: process.ppid,
release: process.release,
version: process.pid,
versions: process.versions,
};
// Execute the expression
try {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call