security(v2.7.2): remediate all 3 Critical P0 & 5 High P1 audit findings (fail-closed auth, webhook hardening + replay protection, auth-first BYOK + SSRF allowlist, minimal public tracker DTO, atomic+DB idempotency, 0 npm vulnerabilities, CI gate)
This commit is contained in:
+16
-3
@@ -81,13 +81,26 @@ interface AuraSsoUser {
|
||||
role: "owner" | "admin" | "client" | "team_member";
|
||||
}
|
||||
|
||||
const OAUTH_FORBIDDEN_DEFAULTS = new Set([
|
||||
"aura_live_mcp_master_key_2026",
|
||||
"aura_ro_public_inspector_2026",
|
||||
"aura_webhook_secret_2026",
|
||||
"change_me",
|
||||
"changeme",
|
||||
"secret",
|
||||
]);
|
||||
|
||||
function getRootSecret(): string {
|
||||
return (
|
||||
const raw = (
|
||||
process.env.AURA_OAUTH_SECRET ||
|
||||
process.env.AURA_API_KEY ||
|
||||
process.env.COURIER_AUTH_TOKEN ||
|
||||
"aura_live_mcp_master_key_2026"
|
||||
);
|
||||
""
|
||||
).trim();
|
||||
if (raw.length < 20 || OAUTH_FORBIDDEN_DEFAULTS.has(raw.toLowerCase())) {
|
||||
throw new Error("AURA_OAUTH_SECRET (or strong AURA_API_KEY >=20 chars) must be configured; predictable defaults are forbidden.");
|
||||
}
|
||||
return raw;
|
||||
}
|
||||
|
||||
function deriveKey(purpose: string): Buffer {
|
||||
|
||||
Reference in New Issue
Block a user