CVE-2026-32722: Memray Cross-Site Scripting Vulnerability
LOWCVE-2026-32722 is a LOW (CVSS 3.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Memray libraries in the PyPI ecosystem. The issue involves stored xss in memray-generated html reports via unescaped command-line metadata. Remediation is available by upgrading affected packages to version 1.19.2.
CVE-2026-32722 at a Glance
Security Impact
CVSS: 3.6
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N).
How to Fix CVE-2026-32722
To remediate this vulnerability, upgrade all affected Memray dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install memray>=1.19.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show memray
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-32722, inspect your installed packages using pip:
pip show memray
Analyze the terminal output to locate any version of Memray in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.19.2), your application is affected.
Note: The pip show memray command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Memray, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-32722 Affected Memray Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
memray
|
PyPI |
< 1.19.2
|
1.19.2
|
References
Frequently Asked Questions
What is CVE-2026-32722?
Which Memray versions are affected?
What version fixes CVE-2026-32722?
Is memray affected?
What is the CVSS score of CVE-2026-32722?
What CWE is associated with CVE-2026-32722?
How can I check PyPI dependencies for CVE-2026-32722?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r5pr-887v-m2w9",
"modified" : "2026-03-19T21:11:02Z",
"published" : "2026-03-16T16:41:58Z",
"aliases" : [ "CVE-2026-32722" ],
"summary" : "Stored XSS in Memray-generated HTML reports via unescaped command-line metadata",
"details" : "## Summary\n\nPrior to Memray 1.19.2, Memray rendered the command line of the tracked process directly into generated HTML reports without escaping. Because there was no escaping, attacker-controlled command line arguments were inserted as raw HTML into the generated report.\n\nThis allowed JavaScript execution when a victim opened the generated report in a browser.\n\n## Affected Version\n\n- Memray version: `1.19.1` and earlier\n\n## Remediation\n\nUpgrade to Memray 1.19.2, and avoid attaching Memray to untrusted processes until you have upgraded.\n\n## Root Cause\n\nJinja is used to embed the process's command line arguments into the generated flame graph or table report. Memray has not been telling Jinja to HTML escape the command line arguments when writing them into the HTML, leading to a stored XSS vulnerability.\n\n## Impact\n\nAn attacker who can influence the script name or command-line arguments of a profiled program can inject HTML/JavaScript into Memray-generated HTML reports (both `memray flamegraph` and `memray table` reports, both with and without `--no-web`). When a victim opens the generated report in a browser, the injected JavaScript executes in the context of the report.\n\nNote that in the case of `memray attach`, the user attaching Memray and generating the report may be a different user than the one who ran the command and set up the command line arguments.\n\n## Proof of Concept\n\nRun Memray on a script with an attacker-controlled filename:\n\n```bash\ntouch '<img src=x onerror=alert(1)>'\npython -m memray run -o poc.bin '<img src=x onerror=alert(1)>'\n```\n\nGenerate a report:\n\n```bash\npython -m memray flamegraph -o poc.html poc.bin\n```\n\n## Observed Result\n\nThe generated HTML contains raw unescaped attacker-controlled HTML.\n\nOpening or reloading the generated report in a browser triggers JavaScript execution.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "memray"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.19.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/bloomberg/memray/security/advisories/GHSA-r5pr-887v-m2w9"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-32722"
}, {
"type" : "WEB",
"url" : "https://github.com/bloomberg/memray/commit/ba6e4e2e9930f9641bed7adfdf43c8e2545ce249"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/bloomberg/memray"
}, {
"type" : "WEB",
"url" : "https://github.com/bloomberg/memray/releases/tag/v1.19.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-79" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-16T16:41:58Z",
"nvd_published_at" : "2026-03-18T22:16:24Z"
}
}