{"id":11061,"date":"2022-01-26T16:28:29","date_gmt":"2022-01-26T16:28:29","guid":{"rendered":"https:\/\/staging-site.42crunch.com\/?p=11061"},"modified":"2022-11-28T18:33:52","modified_gmt":"2022-11-28T18:33:52","slug":"protecting-your-apis-against-log4shell-with-42crunch","status":"publish","type":"post","link":"https:\/\/staging2022.42crunch.com\/protecting-your-apis-against-log4shell-with-42crunch\/","title":{"rendered":"Protecting your APIs against Log4Shell with 42Crunch"},"content":{"rendered":"

On December 9th, 2021, the log4shell<\/cite> vulnerability hit the news and it has since been every security team’s worst nightmare: trivially exploitable, huge impact with RCE (Remote Code Execution), on a component widely used across traditional enterprise technological stacks, both in in-house and third-party software. All this combined explains its CVSS rating of 10 \u2013 the highest possible. It is probably one of the worst flaws I have witnessed in my security career; it gives everything to an attacker for little to no effort. In the last few days, we have seen other vulnerabilities targeting the log4j library.<\/p>\n

Understandably, a lot of articles have been written on the log4shell<\/cite> vulnerability and the subsequent vulnerabilities, to explain\u00a0what it does and how it does it<\/a>, or articles on how to detect attempts of exploitation<\/a>.<\/p>\n

In this article we take a different approach: we show how a positive security model dramatically reduces your attack surface, effectively hindering and\/or blocking such injections, and how a positive security approach can be implemented to secure your APIs from the development phase to the production environments with 42Crunch.<\/p>\n

Creating an API contract<\/h2>\n

Adopting a positive security approach to API design starts with creating an API contract. Think of an API contract as a blueprint of your APIs, a list of formal rules of what your API accepts and how it responds. By definition, in a positive security model, everything not formally allowed by the contract is rejected.<\/p>\n

Two approaches can be used to create an API contract:<\/p>\n