Posts

Unforgivable vulnerabilities

Vulnerabilities are not all born equal. Some are 'forgivable' and others are 'unforgivable', depending on the ease of implementing mitigations.
security

Writing secure software is not trivial. Modern software stacks and systems have many parts, abstraction layers, and complexities that make it difficult to avoid all bugs, including security bugs creating vulnerabilities.

The UK NCSC has done a meta analysis that shows that the number of lines of code per software increases — anyone who’s looked at the size of a JavaScript’s node_modules directory can easily attest to that — and the same is true for the number of defects per line of code. So developers have their work cut out for them.

Vulnerabilities are not all born equal

Some are complex edge cases that are difficult to identify (and, hopefully, exploit), and others are trivial bugs that reflect poor security practices. And it’s this second category that UK NCSC’s proposal is trying to shine some light on.

We know many vulnerabilities are complex and difficult to avoid. But vulnerabilities that are trivial to find (and that occur time and time again) are ones the NCSC are aiming to drive down at scale. These ‘unforgivable vulnerabilities', a phrase coined by Steve Christie in his 2007 MITRE paper, ‘are beacons of a systematic disregard for secure development practices. They simply should not appear in software that has been designed, developed, and tested with security in mind’.

Steve Christie in his 2007 MITRE paper

The report summarises three categories of vulnerabilities:

🔥
Unforgivable vulnerabilities
A vulnerability that should not exist in software, as the difficulty of implementing mitigations is deemed negligible.
This could be because:
  • the mitigation is fully documented
  • it is cheap to implement
  • the technical implementation of the mitigation does not rely on too many (or too complex) prerequisites

Note: There may be multiple causes of a single vulnerability, with each cause having a different mitigation.

🤷
Forgivable vulnerabilities
A vulnerability that exists in software because implementing known mitigations is deemed hard.
This could be because:
  • the vulnerability is subtle
  • there is lack of knowledge about it
  • the cost to implement the mitigation is too high
  • the technical implementation of the mitigation relies on too many (or too complex) prerequisites
💡
Non-exploitable vulnerabilities
There is a third class of vulnerability, which we have called Non-exploitable. We don’t discuss this class further in this paper, but arguably this is a vulnerability that is not a security risk.
This could be because:
  • there is no code path to be able to exploit it, or
  • there are mitigations in place to prevent the vulnerability being exploited, or
  • it is unlikely that chaining vulnerabilities will allow exploitation

Ease of implementation

The report defined an “ease of implementation” score, based on:

CategoryDescriptionScore
Costincluding direct costs (such as licensing a library) and indirect costs (such as additional time needed to code/refactor).1️⃣ cheap2️⃣ some costs3️⃣ expensive
Knowledgehow widely known and understood is the mitigation.1️⃣ well known2️⃣ intermediate3️⃣ obscure
Feasibilitya feasibility analysis evaluates the mitigation’s potential for success, and how easy the mitigation is to achieve. This includes evaluating the advantages and disadvantages of the mitigation, and any technical requirements or prerequisites for the mitigation (such as hardware support).1️⃣ easy2️⃣ possible3️⃣ difficult

The “implementation score” is the sum of the three sub-scores above:

Implementation Score = Cost score + Knowledge Score + Feasibility Score

Implementation ScoreDifficulty
3-4EasyLikely an unforgivable vulnerability 🔥
5-6MediumPossibly and unforgivable vulnerability
7-9Hard

Here is an example for Input Validation.

ScoreEvidence
Cost1Low/no direct and indirect costs
Knowledge1Widely understood and widely available
Feasibility1Many implementations for most/all languages
Total3 (Easy)unforgivable vulnerability 🔥

So a vulnerability caused by a lack of Input Validation would likely be deemed an unforgivable vulnerability.

Further reading

UK NCSC’s proposal goes more in depths with example for all the CWE Top 25 Most Dangerous Software Weaknesses of 2023, and rate them using their scoring system:

Top-level mitigationImplementation ScoreDifficulty
Input Validation3Easy
Output Encoding3Easy
Reduce the Attack Surface5Medium
Enforcement by Conversion5Medium
Sandbox or Jail5Medium
Secure Programming6Medium
Compilation or Build Hardening6Medium
Separation of Privilege6Medium
Libraries or Frameworks6Medium
Secure Architecture and Design7Hard
Language Selection8Hard

All the details on how and why they arrived at these numbers are in the report. It’s absolutely worth a read.

Olivier Reuland

Related