{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2021-39228","id":"CVE-2021-39228","title":"Memory Safety Issue when using patch or merge on state and assign the result back to state","description":"Tremor is an event processing system for unstructured data. A vulnerability exists between versions 0.7.2 and 0.11.6. This vulnerability is a memory safety Issue when using `patch` or `merge` on `state` and assign the result back to `state`. In this case, affected versions of Tremor and the tremor-script crate maintains references to memory that might have been freed already. And these memory regi","descriptionLong":"Tremor is an event processing system for unstructured data. A vulnerability exists between versions 0.7.2 and 0.11.6. This vulnerability is a memory safety Issue when using `patch` or `merge` on `state` and assign the result back to `state`. In this case, affected versions of Tremor and the tremor-script crate maintains references to memory that might have been freed already. And these memory regions can be accessed by retrieving the `state`, e.g. send it over TCP or HTTP. This requires the Tremor server (or any other program using tremor-script) to execute a tremor-script script that uses the mentioned language construct. The issue has been patched in version 0.11.6 by removing the optimization and always cloning the target expression of a Merge or Patch. If an upgrade is not possible, a possible workaround is to avoid the optimization by introducing a temporary variable and not immediately reassigning to `state`.","published":"2021-09-17T14:00:15.000Z","updated":"2026-11-10T02:45:19.081789063Z","reserved":"2021-08-16T00:00:00.000Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"NVD"},{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","rating":"critical","source":"OSV"},{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","rating":"medium","source":"GitHub"},{"version":"2.0","score":7.5,"vector":"AV:N/AC:L/Au:N/C:P/I:P/A:P","rating":"high","source":"NVD"}],"rating":"medium","products":["tremor-rs tremor-runtime"],"affectedProducts":[{"vendor":"tremor-rs","product":"tremor-runtime","defaultStatus":null,"versions":[{"status":"affected","version":"> 0.7.2, < 0.11.6"}],"platforms":[]}],"packages":[{"ecosystem":"crates.io","name":"tremor-script","purl":"pkg:cargo/tremor-script","ranges":[">=0.7.3 <0.11.6"],"fixed":["0.11.6"],"advisory":"GHSA-mc22-5q92-8v85"}],"cwes":["CWE-416","CWE-825"],"aliases":["GHSA-mc22-5q92-8v85"],"references":[{"url":"https://github.com/tremor-rs/tremor-runtime/security/advisories/GHSA-mc22-5q92-8v85","tags":["x_refsource_CONFIRM","x_transferred","Mitigation","Third Party Advisory","advisory","web"]},{"url":"https://github.com/tremor-rs/tremor-runtime/pull/1217","tags":["x_refsource_MISC","x_transferred","Exploit","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/tremor-rs/tremor-runtime/commit/1a2efcdbe68e5e7fd0a05836ac32d2cde78a0b2e","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/tremor-rs/tremor-runtime/releases/tag/v0.11.6","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39228","tags":["advisory"]},{"url":"https://github.com/tremor-rs/tremor-runtime","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":null,"epss":0.01349,"epssPercentile":0.72086,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2021-39228","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-39228","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2021-39228","ok":true,"note":"1 package"},{"name":"GitHub Advisory","url":"https://github.com/advisories/GHSA-mc22-5q92-8v85","ok":true,"note":"GHSA-mc22-5q92-8v85"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2021-39228","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}