mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-16 03:49:26 +00:00
Tasks 1.1, 5.1, 5.2, 5.4 and the data half of 5.3. - mechanisms.toml: closed vocabulary v1 (20 ids) every expected row cites. - vibe-py: 35 Real-Vuln-Benchmark pairs (Apache-2.0), human provenance only because the LLM-generated repositories carry no license (escalated). - vfc-js: 17 Node fix-commit pairs harvested upstream (MIT/Apache-2.0), SecBench.js itself is not vendored (no license); sinks derived on 13/17. - agent-vfc: 29 agent-trailer fixes as catalog-candidates.toml plus REVIEW.md; the loaded catalog stays empty until a human reviews them. - datasets.toml and README document every slice and its review status. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
53 lines
1.9 KiB
JavaScript
53 lines
1.9 KiB
JavaScript
// Provenance: simonh1000/angular-http-server (vuln).
|
|
// repo: simonh1000/angular-http-server
|
|
// commit: d171a771a92e4685b24fb77cb894a7b7b8024c5c
|
|
// parent: d171a771a92e4685b24fb77cb894a7b7b8024c5c
|
|
// commit_url: https://github.com/simonh1000/angular-http-server/commit/8bafc9577161469f5dea01e0b98ea9c525d063e9
|
|
// cve:
|
|
// license: Apache-2.0
|
|
// function: requestListener
|
|
// relpath: angular-http-server.js
|
|
// provenance: human
|
|
// mechanism: path_join_user_input
|
|
// upstream_start: 45
|
|
|
|
function requestListener(req, res) {
|
|
// Add CORS header if option chosen
|
|
if (argv.cors) {
|
|
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
res.setHeader('Access-Control-Request-Method', '*');
|
|
res.setHeader('Access-Control-Allow-Methods', 'OPTIONS, GET');
|
|
res.setHeader('Access-Control-Allow-Headers', 'authorization, content-type');
|
|
// When the request is for CORS OPTIONS (rather than a page) return just the headers
|
|
if (req.method === 'OPTIONS') {
|
|
res.writeHead(200);
|
|
res.end();
|
|
return;
|
|
}
|
|
}
|
|
|
|
// Request is for a page instead
|
|
// Only interested in the part before any query params
|
|
var url = req.url.split('?')[0]
|
|
// Attaches path prefix with --path option
|
|
var possibleFilename = resolveUrl(url.slice(1)) || "dummy";
|
|
|
|
fs.stat(possibleFilename, function(err, stats) {
|
|
var fileBuffer;
|
|
if (!err && stats.isFile()) {
|
|
fileBuffer = fs.readFileSync(possibleFilename);
|
|
let ct = mime.lookup(possibleFilename);
|
|
log(`Sending ${possibleFilename} with Content-Type ${ct}`);
|
|
res.writeHead(200, { 'Content-Type': ct });
|
|
|
|
} else {
|
|
log("Route %s, replacing with index.html", possibleFilename);
|
|
fileBuffer = returnDistFile();
|
|
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
}
|
|
|
|
res.write(fileBuffer);
|
|
res.end();
|
|
});
|
|
}
|