提交 #1056482: beenuar AiSOC 17.0.0 Improper Authentication信息

标题beenuar AiSOC 17.0.0 Improper Authentication
描述AiSOC's global AuditMiddleware (services/api/app/middleware/audit_middleware.py) parses the Authorization Bearer token with jwt.decode(token, options={"verify_signature": False}) and trusts the extracted claims (sub, tenant_id, email) as the acting identity. It then writes every mutating request (POST/PUT/PATCH/DELETE whose response is not 5xx) into the per-tenant tamper-evident SHA-256 audit hash chain (audit_log + audit_chain_head), including requests that were rejected by the route with 401/403/404 - authentication lives in route dependencies, not in this middleware, which is registered globally via app.add_middleware(AuditMiddleware). As a result an unauthenticated attacker can mint a structurally valid JWT signed with any key and forge audit records attributed to an arbitrary user of an arbitrary tenant. The tenant id only has to exist; the Default tenant 00000000-0000-0000-0000-000000000001 is created by the migration chain in every deployment, so it is always known. Verified end-to-end on 2026-10-06/07 against a minimal FastAPI app that mounts the real AuditMiddleware module (copied verbatim from main@d065ce2) on Postgres 16 loaded with the repository's own 103 SQL migrations. A forged request (POST with Authorization: Bearer <token signed with attacker key, claims tenant_id=victim, sub=admin uuid, [email protected]>) returns 200 and writes audit_log row chain_index=0, [email protected], actor_id=<victim admin uuid>, tenant_id=<victim tenant>, with entry_hash computed normally by _append_to_chain and installed as the tenant's new chain head. Control: the identical request without an Authorization header writes 0 rows, proving the unverified JWT claims are the sole identity source. Impact: audit-trail forgery / non-repudiation break (the product positions audit_log as the SOC 2 CC7.2 and ISO 27001 A.12.4 control), framing of any operator for actions they never took, laundering of real activity into a chain that still verifies, plus unauthenticated write amplification through the serialized chain-head lock. Fixed in 17.1.0 (PR #1182, 2026-10-07): the middleware now uses the verified principal. Public advisory: GHSA-w4r8-969c-67p2. CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (7.5), CWE-347. Vendor contacted via GitHub private advisory on 2026-10-05 and confirmed the issue before publication.
来源⚠️ https://github.com/beenuar/AiSOC/security/advisories/GHSA-w4r8-969c-67p2
用户
 waterhunter (UID 101889)
提交2026-10-26 00時45分 (30 日前)
管理2026-11-24 10時13分 (29 days later)
状态已接受
VulDB条目442784 [beenuar AiSOC 直到 17.0.0 AuditMiddleware 弱身份验证]
积分20

Want to stay up to date on a daily basis?

Enable the mail alert feature now!