Skip to content

WS-SEC-02: Audit events are not append-only #134

Description

@catchmeifyoucaan

Finding

The \�udit_events\ table is a regular SQLAlchemy model with no trigger, policy, or application-layer guard preventing UPDATE or DELETE.

Risk

A privileged user or compromised token can modify or delete audit history. No tamper-evident chain exists.

Location

  • \�ackend/app/modules/tasks/models.py:455-476\ — \AuditEvent\ model
  • \�ackend/app/modules/audit/repository.py\ — only provides \�dd_audit_event()\

Recommendation

  1. Add a database trigger or rule preventing UPDATE/DELETE on \�udit_events\
  2. At minimum, add an application-layer permission check that only POST is allowed
  3. Consider \pg_audit\ or an immutable log for critical events

Severity: Medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions