Fix it in your stack

Tested fixes for the weaknesses A09:2025 maps, in Express, Flask and Spring Boot: the vulnerable code, the fix, a wrong fix and the regression tests.

Why it matters

Without logs and alerts, breaches go unnoticed and investigations lack evidence. The 2025 name stresses alerting, because logs that nobody acts on detect nothing.

How to prevent it

  • Log authentication, access-control and server-side validation failures with enough context to investigate, and keep them long enough.
  • Encode log data to prevent injection, and protect logs and audit trails from tampering.
  • Send logs to a central system with alerting rules, and practice an incident response plan.
  • Fail closed: roll back transactions that error instead of leaving them half done.

Guides on this site

Practice

References

  1. A09:2025 Security Logging and Alerting 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.