https://github.com/rack/rack: Improper Neutralization of Escape, Meta, or Control Sequences
CVE-2022-30123 is a critical-severity improper neutralization of escape, meta, or control sequences vulnerability in https://github.com/rack/rack, with a CVSS 3.1 base score of 10.0 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. Affected https://github.com/rack/rack versions: 2.0.9.1, 2.1.4.1, 2.2.3.1. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 1.96% chance of exploitation within 30 days, higher than 81% of scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update Rack to 2.0.9.1 or 2.1.4.1 or 2.2.3.1, whichever matches your release line, 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
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Https://github.com/rack/rack | https://github.com/rack/rack | 2.0.9.1, 2.1.4.1, 2.2.3.1 | Not stated |
| Rack Project | Rack | before 2.0.9.1; 2.1.0 up to, but not including, 2.1.4.1; 2.2.0 up to, but not including, 2.2.3.1 | 2.0.9.1, 2.1.4.1, 2.2.3.1 |
| Debian | Debian Linux | 11.0 | Not stated |
Version data comes from the organisation that assigned the CVE. 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
- ChangedThe attack can reach beyond the vulnerable component into other systems.
- 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:C/C:H/I:H/A:H. Scored by NVD.
Official description
A sequence injection vulnerability exists in Rack <2.0.9.1, <2.1.4.1 and <2.2.3.1 which could allow is a possible shell escape in the Lint and CommonLogger components of Rack.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Neutralization of Escape, Meta, or Control Sequences
The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could be interpreted as escape, meta, or control character sequences when they are sent to a downstream component.
How developers prevent this class of flaw
- Developers should anticipate that escape, meta and control characters/sequences will be injected/removed/manipulated in the input vectors of their product. Use an appropriate combination of denylists and allowlists to ensure only valid, expected and appropriate input is processed by the system.
- While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
More Improper Neutralization of Escape, Meta, or Control Sequences vulnerabilities (CWE-150)
Timeline
- CVE record published.
- Record last changed materially (score, affected products, status or references).
References
Third-party and government advisories
- discuss.rubyonrails.org/t/cve-2022-30123-possible-shell-escape-sequence-injection-vulnerability-in-rack/80728Third Party Advisory
- security.gentoo.org/glsa/202310-18Third Party Advisory
- debian.org/security/2023/dsa-5530Third Party Advisory
Other references
Other vulnerabilities in https://github.com/rack/rack
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
- 7.5 High severity
Spotted an error? Tell us.