CWE-407: Inefficient Algorithmic Complexity | Glexia
CWE-407 (Inefficient Algorithmic Complexity) weakness overview with consequences, detection methods, mitigations, related CVEs and MITRE ATT&CK context.
Glexia's Take · Automated analysis
CWE-407: Quadratic Complexity
Inefficient Algorithmic Complexity represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Availability: DoS: Resource Consumption (CPU),DoS: Resource Consumption (Memory),DoS: Resource Consumption (Other): The typical consequence is CPU consumption, but memory consumption and consumption of other resources can also occur.
Developer Pattern
CWE-407 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Automation confidence
high confidence from CWE-407, 4.20.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Official CWE Definition
CWE-407: Inefficient Algorithmic Complexity
An algorithm in a product has an inefficient worst-case computational complexity that may be detrimental to system performance and can be triggered by an attacker, typically using crafted manipulations that ensure that the worst case is being reached.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- This example attempts to check if an input string is a "sentence" [REF-1164]. ,Note that [REF-1164] has a more thorough (and lengthy) explanation of everything going on within the RegEx.
Remediation
- Use safe APIs
- Centralize the control
- Add regression tests
- Review logs and telemetry for attempted abuse
Detection
- Code review
- SAST
- DAST
- Focused regression tests
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.
