CVE-2021-45701
Description
An issue was discovered in the tremor-script crate before 0.11.6 for Rust. A patch operation may result in a use-after-free.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
The tremor-script crate before 0.11.6 has a use-after-free when using patch or merge on state and assigning the result back to state.
Vulnerability
The tremor-script crate before version 0.11.6 contains a use-after-free vulnerability when using patch or merge operations on state and assigning the result back to state. Specifically, constructs like let state = merge state of event end; or let state = patch state of insert event.key => event.value end; trigger an in-place optimization that manipulates the target value without cloning it. This optimization is safe only when operating on event data or static data, but with the introduction of state (which persists across events), it can lead to memory unsafety [1][3].
Exploitation
An attacker who can control the event data in a tremor-script pipeline can trigger the vulnerable code path. No special authentication or network position beyond normal pipeline operation is required. By crafting specific event data that causes the patch or merge to reference event fields within the assignment-back pattern, the attacker can cause the Value structure to maintain references to memory that has been freed, leading to a use-after-free [1][3].
Impact
Successful exploitation results in memory corruption and potential memory exposure. The attacker may be able to read freed memory or cause undefined behavior, potentially leading to information disclosure or denial of service. The vulnerability affects the tremor-script crate, which is used in the Tremor runtime (tremor-rs/tremor-runtime). The CVSS score is yet to be disclosed, but the advisory categorizes it under memory corruption and memory exposure [1][2][3].
Mitigation
The vulnerability is fixed in version 0.11.6 of the tremor-script crate. The fix involves removing the in-place optimization for patch and merge operations, as described in pull request #1217 on the tremor-rs/tremor-runtime repository [1][4]. Versions earlier than 0.7.2 are unaffected because they did not include the vulnerable optimization [1][3]. Users should upgrade to 0.11.6 or later to mitigate the issue.
- Memory Safety Issue when using `patch` or `merge` on `state` and assign the result back to `state` › RustSec Advisory Database
- NVD - CVE-2021-45701
- https://raw.githubusercontent.com/rustsec/advisory-db/main/crates/tremor-script/RUSTSEC-2021-0111.md
- Remove in-place optimizations of patch and merge by mfelsche · Pull Request #1217 · tremor-rs/tremor-runtime
AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
tremor-scriptcrates.io | >= 0.7.2, < 0.11.6 | 0.11.6 |
Affected products
2- rust/tremor-scriptdescription
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/advisories/GHSA-q2x5-6q7q-r872ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2021-45701ghsaADVISORY
- github.com/tremor-rs/tremor-runtime/pull/1217ghsaWEB
- raw.githubusercontent.com/rustsec/advisory-db/main/crates/tremor-script/RUSTSEC-2021-0111.mdghsax_refsource_MISCWEB
- rustsec.org/advisories/RUSTSEC-2021-0111.htmlghsax_refsource_MISCWEB
News mentions
0No linked articles in our index yet.