Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DmXxNULoSNPvjF7buKipsB
22 lines
822 B
JavaScript
22 lines
822 B
JavaScript
const { exec } = require("child_process");
|
|
const express = require("express");
|
|
const app = express();
|
|
|
|
app.get("/orders/export", (req, res) => {
|
|
// ruleid: cra-ai-20-node-shell-command
|
|
exec("/usr/local/bin/export-orders --customer " + req.query.customer, (err, stdout) => {
|
|
// ruleid: cra-ai-20-node-reflected-input
|
|
res.send("<p>Exported for " + req.query.customer + "</p>" + stdout);
|
|
});
|
|
// ok: cra-ai-20-node-shell-command
|
|
exec("uptime", () => {});
|
|
// ok: cra-ai-20-node-reflected-input
|
|
res.send("<p>" + encodeURIComponent(req.query.customer) + "</p>");
|
|
// ok: cra-ai-20-node-shell-command
|
|
/a(b)/.exec(req.query.customer);
|
|
// ruleid: cra-ai-15-node-cleartext-http
|
|
fetch("http://api.example.com/orders");
|
|
// ok: cra-ai-15-node-cleartext-http
|
|
fetch("https://api.example.com/orders");
|
|
});
|