A08—Software or Data Integrity Failures
>Control Description
>Prevention & Mitigation Strategies
- 1.Use digital signatures or similar mechanisms to verify the software or data is from the expected source and has not been altered.
- 2.Ensure libraries and dependencies, such as npm or Maven, are only consuming trusted repositories. If you have a higher risk profile, consider hosting an internal known-good repository that's vetted.
- 3.Ensure that there is a review process for code and configuration changes to minimize the chance that malicious code or configuration could be introduced into your software pipeline.
- 4.Ensure that your CI/CD pipeline has proper segregation, configuration, and access control to ensure the integrity of the code flowing through the build and deploy processes.
- 5.Ensure that unsigned or unencrypted serialized data is not received from untrusted clients and subsequently used without some form of integrity check or digital signature to detect tampering or replay of the serialized data.
>Attack Scenarios
A company uses an external service provider to provide support functionality. For convenience, it has a DNS mapping for myCompany.SupportProvider.com to support.myCompany.com. Anyone with access to the support provider's infrastructure can steal the cookies of all users that have visited support.myCompany.com and perform a session hijacking attack.
Many home routers, set-top boxes, device firmware, and others do not verify updates via signed firmware. Unsigned firmware is a growing target for attackers and is expected to only get worse. This is a major concern as there is often no mechanism to remediate other than to fix in a future version and wait for previous versions to age out.
A developer, unable to find a needed package through official channels, downloads it from a website online. The package is not signed, and thus there is no opportunity to ensure integrity. The package includes malicious code, creating a supply chain compromise that can affect the entire application.
A React application calls a set of Spring Boot microservices. Being functional programmers, they tried to ensure that their code is immutable. The solution they came up with is serializing the user state and passing it back and forth with each request. An attacker notices the 'rO0' Java object signature (in base64) and uses the Java Serial Killer tool to gain remote code execution on the application server.
>Related CWEs
>References
- •OWASP Cheat Sheet: Software Supply Chain Security
- •OWASP Cheat Sheet: Infrastructure as Code
- •OWASP Cheat Sheet: Deserialization
- •SAFECode Software Integrity Controls
- •A 'Worst Nightmare' Cyberattack: The Untold Story Of The SolarWinds Hack
- •CodeCov Bash Uploader Compromise
- •Securing DevOps by Julien Vehent
- •Insecure Deserialization by Tenendo
Ask AI
Configure your API key to use AI features.