Fix it in your stack

Tested fixes for the weaknesses A08:2025 maps, in Express, Flask, Spring Boot, ASP.NET Core, Next.js, FastAPI, Django, net/http, Rails and Laravel: the vulnerable code, the fix, a wrong fix and the regression tests.

Why it matters

When code, updates or data are trusted without checking their integrity, anyone who can change them, in transit, in a repository or inside a serialized object, controls what runs.

How to prevent it

  • Verify digital signatures or equivalent integrity checks on software, updates and critical data.
  • Consume dependencies only from trusted repositories, or from a vetted internal mirror.
  • Review code and configuration changes, and protect the CI/CD pipeline with segregation and access control.
  • Do not accept unsigned serialized data from untrusted clients, and never deserialize it with native object formats.

Guides on this site

Main subject · Guide

Protect the path from pull request to release

Separate untrusted contribution checks from privileged release work and verify the identity of the artifact that is actually deployed.

Main subject · Guide

Design firmware updates that can recover safely

Connect trusted boot, update authorization, rollback policy and end-of-life behavior to the device’s actual failure modes.

Main subject · Guide

Verify artifact signatures against an explicit trust policy

Require the expected artifact, signer and release context before allowing a signed package or image to proceed.

Main subject · Guide

Read SLSA provenance and verify the claim you need

Connect an artifact to its build evidence while distinguishing provenance, build assurance and source controls.

Main subject · Guide

Protect package publication and the update channel

Constrain release identities, verify what consumers receive, and prepare for publisher or update-key compromise.

Main subject · Guide

Parse bounded JSON and XML into an explicit application schema

Separate parser capabilities from schema rules, reject ambiguous and coercible inputs, and implement the boundary in a complete Python project.

Also covers this · Guide

Verify webhook deliveries before acting

Verify the provider’s signature over the correct bytes, then apply replay, authorization, and idempotency controls before a business action.

Also covers this · Guide

Authorize functions and fields as well as objects

Prevent mass assignment, sensitive-field exposure and administrative actions that a valid object lookup alone cannot protect.

Also covers this · Guide

Keep untrusted values out of executable syntax

Choose a safe interface for each interpreter and bound the work performed by parsers and converters.

Also covers this · Guide

Prove network and admission policies enforce the intended boundary

Verify allowed traffic and rejected deployments in the cluster instead of treating policy files as evidence of isolation.

Also covers this · Guide

Keep untrusted CI work outside the release boundary

Review workflow authority, persistent state and artifact handoffs before contributor-controlled code reaches privileged jobs.

Also covers this · Guide

Investigate a suspected malicious package safely

Distinguish package substitution, publisher compromise and dangerous installation behavior while containing exposure and preserving evidence.

Also covers this · Guide

Investigate build differences and improve reproducibility

Control inputs and environment, compare artifact bytes, and explain the security properties a repeatable build can demonstrate.

Also covers this · Guide

Treat model releases as executable supply-chain inputs

Verify provenance, constrain loading and preserve the relationship between model weights, configuration and runtime dependencies.

Also covers this · Case study

Flame: MD5 certificate forgery

Follow how a weak digest and an overpowered certificate trust path enabled forged code-signing authority, without equating the event with RSA key theft.

Also covers this · Guide

Keep untrusted object keys out of prototype and authority paths

Trace an actual nested-merge mutation, replace it with a narrow schema, and make authorization independent of inherited properties.

Also covers this · Case study

Case study: Log4Shell (CVE-2021-44228)

How a JNDI lookup in Apache Log4j became internet-wide remote code execution, why transitive and shaded dependencies made it so hard to patch, which mitigations held, and what it teaches about dependency inventory and SBOMs.

Practice

References

  1. A08:2025 Software or Data Integrity Failures (OWASP)

List data from the publisher. A guide is listed as the main subject when the weakness or risk is what the guide is about, and as covering it when a dedicated section or worked example addresses it.