Files
codeql/javascript/ql/test/experimental/Security/CWE-099/EnvValueInjection/test.js
2026-07-05 17:41:04 +01:00

11 lines
327 B
JavaScript

const http = require('node:http');
http.createServer((req, res) => {
const { EnvValue } = req.body; // $ Source
process.env["A_Critical_Env"] = EnvValue; // $ Alert // NOT OK
process.env[AKey] = EnvValue; // $ Alert // NOT OK
process.env.AKey = EnvValue; // $ Alert // NOT OK
res.end('env has been injected!');
});