Crow: Off-by-one Error
CVE-2022-34970 is a critical-severity off-by-one error vulnerability in Crow from CrowCpp, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version 1.0\+4 as the first without the flaw, so updating Crow to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 3.96% chance of exploitation within 30 days, which is in the top 9.38% of all scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update Crow to 1.0\+4 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
Version data comes from NVD's product matching. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
Official description
Crow before 1.0+4 has a heap-based buffer overflow via the function qs_parse in query_string.h. On successful exploitation this vulnerability allows attackers to remotely execute arbitrary code in the context of the vulnerable service.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Off-by-one Error
A product calculates or uses an incorrect maximum or minimum value that is 1 more, or 1 less, than the correct value.
How developers prevent this class of flaw
- When copying character arrays or using character manipulation methods, the correct size parameter must be used to account for the null terminator that needs to be added at the end of the array. Some examples of functions susceptible to this weakness in C include strcpy(), strncpy(), strcat(), strncat(), printf(), sprintf(), scanf() and sscanf().
Timeline
- CVE record published.
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/CrowCpp/Crow/pull/486Third Party Advisory
- github.com/CrowCpp/Crow/releases/tag/v1.0%2B4Third Party Advisory
Third-party and government advisories
- cwe.mitre.org/data/definitions/193.htmlThird Party Advisory
Technical write-ups (may include proof of concept)
- github.com/0xhebi/CVE-2022-34970/blob/master/report.mdExploit, Third Party Advisory
Other vulnerabilities in Crow
- 7.5 High severity
- 7.5 High severity
- 9.8 Critical severity
Recent Off-by-one Error vulnerabilities
- 7.8 High severity
Sudo Heap-Based Buffer Overflow Exploited
Spotted an error? Tell us.