EnergyVenom's picture
Astra 0598704: 26D AP/AR/GL fixes verified live, payments, subledger accounting, edge cases, learned navigation, consultant step import (059870495533)
2d71dc3 verified
|
Raw History Blame Contribute Delete
14.2 kB

Security

Report a vulnerability privately to the repository owner; do not open a public issue.

Controls in place

Area Control Where
Passwords argon2id; at most FPT_HASH_CONCURRENCY hashes at once (memory-exhaustion guard) platform/users.py
Sign-in 5 failed attempts per user and visitor in 5 minutes, then paused; also 50 per name across all visitors (FPT_LOGIN_MAX_PER_USER) and, behind a trusted proxy (FPT_TRUST_PROXY), 30 per visitor across all names (FPT_LOGIN_MAX_PER_IP); failed names that are not accounts are audited as a fingerprint only platform/users.py, api/routes/auth.py, __main__.py
Request size bodies over FPT_MAX_BODY_BYTES (12 MB) refused with 413, also while streaming; a runner bundle may unpack to at most FPT_RUNNER_BUNDLE_MAX_MB (2 GB); * in FPT_CORS_ORIGINS is ignored api/middleware.py, adapters/remote_runner.py, api/app.py
Sessions server-side, httpOnly cookie, SameSite Strict (None only when embedded), Secure behind https; browser-session cookie unless "keep me signed in" (7 days); password change or reset ends other sessions api/routes/auth.py
CSRF double-submit token checked on every unsafe cookie request api/auth.py
Authorization role permissions enforced server-side on every route (require(perm)) platform/users.py PERMISSIONS
Registration new accounts are viewers; admin list applies only to confirmed addresses; can be switched off api/routes/auth.py, feature switches
Input pydantic Strict models on all request bodies api/schemas.py
Output errors in one format {detail, code, request_id}; 500s carry no stack trace api/errors.py
Headers CSP, X-Frame-Options, nosniff, Referrer-Policy, Permissions-Policy, HSTS behind https api/middleware.py
CORS none needed in production (FPT_CORS_ORIGINS=[]) config.py
Outbound calls one egress gate, host-pinned, audited, kill switch platform/egress.py
Notifications webhook to the configured host only (https), HMAC-SHA256 signed, retried then given up; payload is plain words, run names, area names and counts, never secrets, test data or screenshots; errors redacted platform/notify.py
Telegram notifications sent only to api.telegram.org through the egress gate; the bot token is a secret (vault / Space secret) that is never logged or returned: the audit shows api.telegram.org/bot(hidden)/..., error texts have it removed, and refused requests are audited with the hidden address too; same message content rules as the webhook; only administrators choose the chat platform/notify.py
Two-way bot (Telegram, Teams next) a chat is linked to one Astra account by a one-time code made by that signed-in person (hashed, single use, 10 minutes, 5 tries per 10 minutes); the bot then acts as that person with their role: free text and /run go through the Ask service (propose, then the person's button press re-checks RBAC and state through api/actions.py); buttons carry only a random id, stored server-side and bound to chat, person, 24-hour expiry and single use; sign-off, failure verdicts, the kill switch and administration are never offered (links only); every step audited as channel.*; notifications reach a linked person only for runs they may read, from when they linked; the bot token is masked in HTTP client logs as well channels/, api/routes/channels.py, docs/CHANNELS.md
MCP connector personal access tokens (pwt_, shown once, SHA-256 at rest, compared in constant time, 1 to 365 days, revocable by the owner or an administrator), accepted only on /mcp and refused on /api; always the owner's current role (disabled owners refused); scopes read or read,act; acting is propose → confirm (single use, 10 minutes, same person and token, re-checks role, run state and the emergency stop); sign-off, verdicts, the emergency stop and administration never offered; 60 requests a minute per token, 64 KB bodies, foreign browser origins refused, no CORS, cookies ignored; tokens masked in logs, never in the audit (token.*, mcp.* events) api/mcp.py, platform/api_tokens.py, docs/MCP.md
A2A agent the same personal access tokens, scopes, per-token rate limit (shared with /mcp), origin guard and propose → confirm path as MCP, at /a2a (bodies up to 256 KB, 20 parts, 8,000 characters of text, 50 cases); the agent card at /.well-known/agent-card.json is public and holds no secrets; tasks are bound to their owner and token (admins can read, not act); a caller can never approve custom cases, scenarios or failures, sign off, waive or touch the emergency stop; caller facts (pod, patch changes) are stored as untrusted data, never sent to an LLM as instructions, and their URLs are displayed only, never fetched; every task, state change, proposal, confirm, run, refusal and cancel is audited as a2a.* without tokens api/a2a.py, docs/A2A.md
Oracle AI Agent Studio OAuth 2.0 client credentials (client secret kept as a hash; bearer tokens pwa_, one hour, hashed at rest, scope patchwise.invoke only: start cycles, forward approvals, read their status); test data must be synthetic and values that look like personal or payment data are refused; callbacks HMAC-signed with the client's signing key (kept in the vault), sent through the egress gate to the client's own address only platform/agent_studio.py, docs/AGENT_STUDIO.md
Secrets FPT_SECRET_* environment values or the vault file (plain JSON, mode 600, encrypted only inside the state snapshot: see Residual risks); never in API answers, logs or child processes platform/vault.py, platform/procs.py
State snapshot FPT_HOME archived and encrypted (Fernet, FPT_STATE_KEY) before it leaves; the bucket holds ciphertext only; the OCI pre-authenticated URL is read from the environment or the vault only and audited with its token replaced by *** platform/statesync.py, platform/ocistore.py
Remote runner HTTPS behind Caddy, bearer token compared in constant time, one job at a time, allow-listed environment keys, configs and file names; the token is never passed to Playwright; the Fusion session file is never returned automation/remote_runner/server.py, docs/REMOTE_RUNNER.md
AI calls client data masked before a request leaves and restored in the answer; a payload that still looks like client data is not sent to the external model platform/step_writer.py, platform/redaction.py, llm/router.py
Fusion production pods refused; read-only except seeding and cancelling test data; password kept out of traces platform/pods.py, automation/src/fusion/ui.ts
Audit append-only, hash-chained, verifiable (/api/audit/verify) platform/audit.py
Public surface anonymous /api/ready shows no internals; API docs off in production api/routes/admin.py
Exports CSV cells that start with = + - @ are neutralised api/routes/runs.py

The full review with findings and status: SECURITY-REVIEW.md.

Residual risks

Risks that remain in the running system, with what limits them today.

Risk Detail What limits it
Plain-text vault, and the evidence key in the same archive The vault (FPT_HOME/secrets/vault.json) is a plain JSON file on the server's disk. It holds EVIDENCE_KEY, the pods' test-user passwords entered in the app, the AI model key saved in Settings, the link signing key, Agent Studio signing keys and Fusion client secrets, and the chat webhook addresses. The state snapshot and the Compose backup contain both the vault and the encrypted evidence, so whoever can open the archive can also read the evidence. File mode 600; the snapshot is encrypted with FPT_STATE_KEY before it leaves; the Compose backup must be encrypted by the operator. Keep FPT_STATE_KEY apart from the bucket's credentials.
Snapshot key Unless FPT_STATE_KEY is set, the snapshot key is derived from the Supabase service key (S8). Set FPT_STATE_KEY (required with OCI).
Runner token and Fusion password on every attempt Each attempt and screen read sends the runner token (header) and the Fusion test user's password (body) to the runner over HTTPS. On the runner the password is in the Playwright process's environment. HTTPS only (egress gate, runner host pinned); the audit log never records the password; a test pod's test user only, never production. Rotate both if the runner host is compromised.
Unencrypted job data on the runner Screenshots, videos, traces, logs and the values tried stay unencrypted in the runner's job folders for RUNNER_KEEP_HOURS (24 h), including folders from before a runner restart (swept by age). A killed job may leave the Fusion session file there until the sweep. The service listens on loopback only, behind Caddy. Keep the runner host single-purpose, with few logins and an encrypted disk.
Signed Excel links need no login The Excel test-script link in Agent Studio events (/api/share/runs/{id}/test-script.xlsx?exp=...&sig=...) opens without a login for 7 days. Anyone who has the link can download that one file. HMAC-signed for one run and one file, read-only, expires; changing LINK_SIGNING_KEY in the vault ends every link already sent.
Masking before AI calls is pattern-based platform/redaction.py masks e-mail addresses, amounts, document numbers, numbers of 4 digits or more, the client names the scout registered (business units, ledgers, suppliers and other sampled test data) and vault secrets. A client name it does not know, or free text in an unusual shape, is not recognised. Oracle's own screen labels are sent as they are. Only public or masked payloads go to the external model; a payload the leak check still flags is not sent there. Custom test cases go to a model only as placeholders, step by step (see the custom cases section). Use a local model when the client does not agree to an external one.
Supabase sign-up Supabase "Confirm email" must stay on for the admin list to be safe (S5). Keep it on in the Supabase project's settings.
Personal tokens in shared agents A Copilot Studio agent using a personal token acts as that one person for everyone who uses the agent. Use a read token from a least-privileged account until OAuth (docs/MCP.md, phase 2).
Dependencies react-router 6 has two moderate advisories fixed only in 7.x; the open-redirect one is not reachable here (the return path after sign-in is checked). Python dependencies are pinned at top level only; base images are not digest-pinned. npm audit in CI (QUALITY.md).

Decisions on the older findings are recorded in AUDIT.md.

Rotating secrets

Set the new value in the platform's secret store and restart. For the Fusion test user also update the user in Fusion first. Exposed keys must be revoked at the provider (NVIDIA, Hugging Face, Supabase, OCI), not only replaced here. For the runner token and OCI_STATE_PAR_URL, see RUNBOOK "Rotating secrets".

Incoming-webhook integrations (Slack, Teams, Google Chat, Discord)

  • The webhook address is a bearer credential. It is accepted only from administrators, validated against the service's own host and path (https, no user info, standard port), stored in the vault, registered with the redactor, and never returned.
  • The server log masks webhook paths and query strings for all four services (and Telegram bot tokens) in every line the HTTP client writes; the audit records only the host. Delivery errors are stored and printed with the address removed.
  • Message text from the app is neutralised per service: Slack & < > escaped, Google Chat angle brackets replaced, Discord allowed_mentions empty, so nothing the app writes can mention a whole channel or inject links.
  • Messages carry run names, areas and counts only (the same outbox rules as the other channels: no secrets, credentials, test data values or screenshots).

Custom test cases (Excel, text, JSON)

  • Consultants and above only (run.start); approving or rejecting needs gate.approve_cases, the same as approving scenarios. Nothing runs before a person approves a scenario whose dry run passed; there is no automatic approval, also not for agents. A run accepts approved keys only and goes through the normal run path (kill switch included).
  • Uploads: .xlsx only, at most 2 MB, must be a zip container; opened read-only with cached values only, so formulas are never evaluated and macros never loaded. The uploaded file name is never used as a path; batch ids are checked against [A-Za-z0-9_-] and area codes against [A-Z][A-Z0-9]{1,5}, so staged and promoted paths can't be steered.
  • Limits: 50 scenarios × 40 steps per batch, 50,000 characters of text, 500 characters per step. JSON is strict (unknown fields refuse the batch).
  • Custom cases may contain client data. Steps are mapped by a fixed grammar first (no model). Only a step the grammar can't map is given to the app's own model (platform/manual_steps.py), and only after every value in it (names, amounts, numbers and ids, quoted text, e-mails, any capitalised word that isn't Fusion's own vocabulary, and every value the case's data and its grammar-mapped steps hold) is replaced by a {{tv.x}} placeholder; the real values stay in the case. The request is sent as redacted through the router, so the router's rules decide (no model switched on, or a payload the redactor still flags: nothing is sent and the step is returned to be reworded, with the reason). The answer passes check_steps and a no-values-of-its-own check before it is used, and a person looks at it before the scenario is built. A client name in lower case that no rule or the redactor knows is the one thing this can't recognise. Word and CSV files are read with the standard library only (no macros, no entity expansion). Text is stored and returned as data; the web app renders it escaped.
  • Drafts live in FPT_HOME/staging until approval. Parsing, building, the dry run, approval, rejection and runs are audited (custom_cases.*).