Skip to content

Process Engine outbound webhooks lack HMAC signature verification #266

Closed

Description

@vybe

CSO Audit Finding #2 — 2026-04-05

Severity: HIGH | Confidence: 9/10 | Status: VERIFIED
Category: Webhooks (A08 — Software and Data Integrity Failures)
Phase: P6 — Webhook & Integration Audit

Description

Outbound webhook calls from the Process Engine to external systems include no HMAC signature header. Recipients cannot verify that Trinity is the origin of the event.

File: src/backend/services/process_engine/events/webhook_publisher.py (lines 100-117)

async def _send_webhook(self, url: str, payload: dict) -> None:
    async with httpx.AsyncClient() as client:
        response = await client.post(
            url,
            json=payload,
            timeout=10.0,
            headers={"Content-Type": "application/json"},  # No signature!
        )

Note: Inbound webhooks (Slack, Telegram) ARE properly signed — this gap is outbound only.

Exploit Scenario

Attacker sends forged POST to a webhook receiver URL with a fake process_completed event → triggers downstream automation (CI deploy, Slack alert, database update) without Trinity ever running the process.

Remediation

Add X-Trinity-Signature and X-Trinity-Timestamp HMAC-SHA256 headers to outbound webhooks:

timestamp = str(int(time.time()))
message = f"{timestamp}.{json.dumps(payload)}"
signature = hmac.new(
    webhook_secret.encode(), message.encode(), hashlib.sha256
).hexdigest()
headers = {
    "Content-Type": "application/json",
    "X-Trinity-Signature": f"v1={signature}",
    "X-Trinity-Timestamp": timestamp,
}

Estimated effort: 2-4 hours

References

  • CSO report: docs/security-reports/cso-2026-04-05.md

Activity

  1. added
    priority-p1
    security
    severity-high
    on Apr 5, 2026
  2. added
    status-in-progress
    on Apr 8, 2026
  3. removed
    status-in-progress
    on Apr 17, 2026
  4. added
    complexity-low
    on Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p1securityseverity-high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions