redis: Improper Control of Generation of Code
CVE-2022-24735 is a high-severity improper control of generation of code vulnerability in redis, with a CVSS 3.1 base score of 7.8 out of 10. It can be exploited with local access to the system by an unauthenticated attacker, but only if a user takes part, for example by opening a link or file. Affected redis versions: < 7.0.0; >= 6.0.0, < 6.2.7. The record does not name a fixed version, so check the vendor advisory. There is no confirmed exploitation so far. EPSS estimates a 2.25% chance of exploitation within 30 days, higher than 83% of scored CVEs.
High severity with no evidence of exploitation so far.
What to do
- Check which version of redis you run against the affected versions below, and install the vendor's latest release.
- Read the advisory on github.com for workarounds and exact fixed builds.
- Because the attack needs a user to take part, warn users about unexpected links and files related to this product until it is patched.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Redis | redis | < 7.0.0; >= 6.0.0, < 6.2.7 | Not stated |
| Fedora Project | Fedora | 34; 35; 36 | Not stated |
| NetApp | Management Services For Element Software | Not specified in the record | Not stated |
| NetApp | Management Services For Netapp Hci | Not specified in the record | Not stated |
| Oracle | Communications Operations Monitor | 4.3; 4.4; 5.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
- LocalThe attacker needs local access or must trick a user into running something.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- RequiredA user must take an action such as opening a file or link.
- 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:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 3.9 | Low | CNA (github.com) |
| CVSS 3.1 | 7.8 | High | NVD |
| CVSS 2.0 | 6.8 | Medium | NVD |
Official description
Redis is an in-memory database that persists on disk. By exploiting weaknesses in the Lua script execution environment, an attacker with access to Redis prior to version 7.0.0 or 6.2.7 can inject Lua code that will execute with the (potentially higher) privileges of another Redis user. The Lua script execution environment in Redis provides some measures that prevent a script from creating side effects that persist and can affect the execution of the same, or different script, at a later time. Several weaknesses of these measures have been publicly known for a long time, but they had no security impact as the Redis security model did not endorse the concept of users or privileges. With the introduction of ACLs in Redis 6.0, these weaknesses can be exploited by a less privileged users to inject Lua code that will execute at a later time, when a privileged user executes a Lua script. The problem is fixed in Redis versions 7.0.0 and 6.2.7. An additional workaround to mitigate this problem without patching the redis-server executable, if Lua scripting is not being used, is to block access to `SCRIPT LOAD` and `EVAL` commands using ACL rules.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Control of Generation of Code
The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
How developers prevent this class of flaw
- Refactor your program so that you do not have to dynamically generate code.
- Run your code in a jail or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which code can be executed by your product. Examples include the Unix chroot jail and AppArmor. In general, managed code may provide some protection. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of your application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails.
- Use dynamic tools and techniques that interact with the product using large test suites with many diverse inputs, such as fuzz testing (fuzzing), robustness testing, and fault injection. The product's operation may slow down, but it should not become unstable, crash, or generate incorrect results.
More Improper Control of Generation of Code vulnerabilities (CWE-94)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: partial).
- Record last changed materially (score, affected products, status or references).
References
Advisories
- github.com/redis/redis/security/advisories/GHSA-647m-2wmq-qmvqThird Party Advisory
Patches and release notes
- github.com/redis/redis/pull/10651Exploit, Third Party Advisory
- github.com/redis/redis/releases/tag/6.2.7Release Notes, Third Party Advisory
- github.com/redis/redis/releases/tag/7.0.0Release Notes, Third Party Advisory
- oracle.com/security-alerts/cpujul2022.htmlThird Party Advisory
Third-party and government advisories
- security.gentoo.org/glsa/202209-17Third Party Advisory
- security.netapp.com/advisory/ntap-20220715-0003/Third Party Advisory
Other references
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/J4ZK3675DGHVVDOFLJN7…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/VPYKSG7LKUJGVM2P72EH…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WSTPUCAPBRHIFPSCOURR…
Other vulnerabilities in redis
- 7.1 High severity
- 7.5 High severity
- 8.8 High severity
- 8.1 High severity
- 8.8 High severity
- 8.8 High severity
Recent Improper Control of Generation of Code vulnerabilities
- 9.8 Critical severity
- 7.2 High severity
- 10.0 Critical severity
OSGeo GeoServer JAI-EXT Code Injection Exploited
- 9.8 Critical severity
- 8.8 High severity
- 7.2 High severity
Spotted an error? Tell us.