| 제목 | 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. AM 12:45 (29 날 ago) |
|---|
| 모더레이션 | 2026. 11. 24. AM 10:13 (29 days later) |
|---|
| 상태 | 수락 |
|---|
| VulDB 항목 | 442784 [beenuar AiSOC 까지 17.0.0 AuditMiddleware 약한 인증] |
|---|
| 포인트들 | 20 |
|---|