📋 What Is It?
An Output Integrity Attack targets the model's result after the model produced it. The attacker tampers with the prediction on the path between the model and whatever consumes it-a service, a database, a queue, a dashboard, or the UI-so the decision the system acts on is not the decision the model actually made. This is a failure of integrity, not accuracy: the model can be perfectly correct, and the system still wrong. It is not ML01 (fooling the model with a crafted input).
⚠️ Common Exploits
- MITM in Transit: plain-HTTP inference API rewritten in flight
- Gateway/Adapter Tampering: a compromised hop substitutes a verdict
- Client-Trusted Value: browser/thick client edits the decision
- Results-Store Edit: over-broad write access flips a row at rest
- Queue/Cache Poisoning: replacement message or seeded key
- Log Tampering: mutable, unsigned records corrupt downstream feeds
- Replay: a stale but valid result re-served for the current one
- Impostor Producer: forged "model output" the consumer accepts
🔴 Attack Flow
↓
2. Find an unprotected hop (plain HTTP, broad write)
↓
3. Rewrite the result in transit / at rest / at the UI
↓
4. Consumer acts on the attacker's value
↓
5. IMPACT: fraud/malware/deny flipped to allow - model metrics stay green!
❌ Vulnerable Code
✅ Secure Code
✓ Prevention Checklist
- Encrypt AND authenticate every hop with TLS / mTLS
- Sign or HMAC every result at the producer
- Verify the signature at the consumer - fail closed on failure
- Sign a canonical serialization so verification is deterministic
- Bind freshness with a nonce + timestamp to defeat replay
- Store the signed envelope in DBs/queues/caches, verify on read
- Keep the authoritative decision server-side, never client-trusted
- Bind each result to its request/transaction id
- Sanity-check outputs (schema, allowed labels, score range)
- Least privilege: only the producer writes results
- Use tamper-evident (append-only / hash-chained) logs
- Reconcile produced vs. enforced decisions; alert on divergence
🔍 Detection & Tools
Authenticity & Integrity:
Storage & Audit:
How to Test:
- Attempt an on-path rewrite of a prediction response
- Edit a stored result row and confirm the consumer rejects it
- Replay a captured old result and verify freshness blocks it
- Forge a result from an impostor source - must fail auth
- Tamper a client-supplied verdict; server must re-derive/verify
- Alert on spikes in signature/nonce/staleness rejections
🌍 Real-World
Public post-mortems rarely name "the model was right but the output was tampered," so these are well-established weakness classes applied to ML decisions (no fabricated CVEs or statistics):
- MITM on unauthenticated decision channels: a result carried over cleartext is rewritten in flight by an on-path attacker-the classic cleartext-tampering weakness, here the tampered value is the decision itself
- Tampering at rest in a shared store/queue: a principal with over-broad write access edits stored results before asynchronous consumers read them
- Client-side trust of a decision value: a front-end trusts a verdict the client can edit, so the acted-on decision is not the model's
📌 Quick Tips
- DO NOT trust a prediction because the model is accurate
- DO NOT rely on TLS alone once a result is stored/forwarded
- DO NOT let a client-supplied verdict drive the decision
- DO sign the result and verify before acting
- DO use TLS/mTLS on every hop
- DO bind freshness with a nonce + timestamp
- DO use tamper-evident logs and reconciliation