GHSA-jpv3-g4cc-6vfx CVE-2019-0222
Improper Control of Generation of Code ('Code Injection') in org.apache.activemq:activemq-client
- Severity
- 7.5 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 12.03%
- Chance of exploitation in the next 30 days. Higher than 96.14% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- CWE-94 Improper Control of Generation of Code ('Code Injection')
- Fix
5.15.9- Upgrade org.apache.activemq:activemq-client to this version or later
Description
In Apache ActiveMQ 5.0.0 - 5.15.8, unmarshalling corrupt MQTT frame can lead to broker Out of Memory exception making it unresponsive.
Affected versions
Maven
| Package | Vulnerable | Fixed in |
|---|---|---|
| org.apache.activemq:activemq-client | >= 5.0.0, < 5.15.9 |
5.15.9 |
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
org.apache.activemq:activemq-client Maven → 5.15.9
- maven
<dependency><groupId>org.apache.activemq</groupId><artifactId>activemq-client</artifactId><version>5.15.9</version></dependency>- gradle
implementation("org.apache.activemq:activemq-client:5.15.9")
Severity breakdown
CVSS 3.1 7.5
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Weakness
CWE-94: Improper Control of Generation of Code ('Code Injection')
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 to prevent it
- Architecture and Design: Refactor your program so that you do not have to dynamically generate code.
- Architecture and Design: 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.
- Implementation: Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright. To reduce the likelihood of code injection, use stringent allowlists that limit which constructs are allowed. If you are dynamically constructing code that invokes a function, then verifying that the input is alphanumeric might be insufficient. An attacker might still be able to reference a dangerous function that you did not intend to allow, such as system(), exec(), or exit().
- Testing: 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.
- Operation: Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
- Operation: Run the code in an environment that performs automatic taint propagation and prevents any command execution that uses tainted variables, such as Perl's "-T" switch. This will force the program to perform validation steps that remove the taint, although you must be careful to correctly validate your inputs so that you do not accidentally mark dangerous inputs as untainted (see CWE-183 and CWE-184).
- Implementation: For Python programs, it is frequently encouraged to use the ast.literal_eval() function instead of eval, since it is intentionally designed to avoid executing code. However, an adversary could still cause excessive memory or stack consumption via deeply nested structures [REF-1372], so the python documentation discourages use of ast.literal_eval() on untrusted data [REF-1373].
References
Advisories
Packages
Other links
- github.com/apache/activemq/commit/98b9f2e
- github.com/apache/activemq/commit/f78c0962ffb46fae3397eed6b7ec1e6e15045031
- oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
- oracle.com/security-alerts/cpujul2020.html
- oracle.com/security-alerts/cpuapr2020.html
- web.archive.org/web/20190404065432/http://www.securityfocus.com/bid/107622
- security.netapp.com/advisory/ntap-20190502-0006
- lists.debian.org/debian-lts-announce/2021/03/msg00005.html
- lists.debian.org/debian-lts-announce/2021/03/msg00004.html
- lists.apache.org/thread.html/re4672802b0e5ed67c08c9e77057d52138e062f77cc09581b723cf95…
- lists.apache.org/thread.html/rb698ed085f79e56146ca24ab359c9ef95846618675ea1ef402e04a6…
- lists.apache.org/thread.html/r946488fb942fd35c6a6e0359f52504a558ed438574a8f14d36d7dcd…
- lists.apache.org/thread.html/fcbe6ad00f1de142148c20d813fae3765dc4274955e3e2f3ca19ff7b…
- lists.apache.org/thread.html/d1e334bd71d6e68462c62c726fe6db565c7a6283302f9c1feed087fa…
- lists.apache.org/thread.html/a859563f05fbe7c31916b3178c2697165bd9bbf5a65d1cf62aef27d2…
- lists.apache.org/thread.html/7da9636557118178b1690ba0af49c8a7b7b97d925218b5774622f488…
- lists.apache.org/thread.html/71640324661c1b6d0b6708bd4fb20170e1b979370a4b8cddc4f8d485…
- lists.apache.org/thread.html/2b5c0039197a4949f29e1e2c9441ab38d242946b966f61c110808bcc…
- lists.apache.org/thread.html/03f91b1fb85686a848cee6b90112cf6059bd1b21b23bacaa11a962e1…
- activemq.apache.org/security-advisories.data/CVE-2019-0222-announcement.txt
- openwall.com/lists/oss-security/2019/03/27/2
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-crg9-44h2-xw35 Apache ActiveMQ is vulnerable to Remote Code Execution | Critical Known exploited | Also affects org.apache.activemq:activemq-client |
| GHSA-rxqh-fc23-gxp2 Improper Input Validation in Apache ActiveMQ | Critical Known exploited | Also affects org.apache.activemq:activemq-client |
| GHSA-5568-6qcg-g7fx Apache ActiveMQ: Denial of Service via Out of Memory vulnerability | High | Also affects org.apache.activemq:activemq-client |
| GHSA-h2h4-5m64-m273 Apache ActiveMQ: Improper validation and restriction of a classpath path name | Medium | Also affects org.apache.activemq:activemq-client |
| GHSA-whxr-3p84-rf3c Apache ActiveMQ: Unchecked buffer length can cause excessive memory allocation | High | Also affects org.apache.activemq:activemq-client |
| GHSA-p358-58jj-hp65 Improper Authentication in Apache ActiveMQ | Medium | Also affects org.apache.activemq:activemq-client |
| GHSA-mfhr-3xmc-r2gg Improper Neutralization of Input During Web Page Generation in Apache ActiveMQ | Medium | Also affects org.apache.activemq:activemq-client |
| GHSA-3wfj-vh84-732p Improper Neutralization of Special Elements used in an OS Command in Apache ActiveMQ | High | Also affects org.apache.activemq:activemq-client |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor