CVE-2026-32722
Memray-generated HTML reports vulnerable to Stored XSS via unescaped command-line metadata
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- None
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
3.6
Memray-generated HTML reports vulnerable to Stored XSS via unescaped command-line metadata
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
CVE-2026-32722- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
EUVDEUVD-2026-12970
3.6
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
EUVD-2026-12970- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-r5pr-887v-m2w9
3.6
Stored XSS in Memray-generated HTML reports via unescaped command-line metadata
Summary
Prior 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.
This allowed JavaScript execution when a victim opened the generated report in a browser.
Affected Version
- Memray version:
1.19.1and earlier
Remediation
Upgrade to Memray 1.19.2, and avoid attaching Memray to untrusted processes until you have upgraded.
Root Cause
Jinja 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.
Impact
An 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.
Note 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.
Proof of Concept
Run Memray on a script with an attacker-controlled filename:
touch '<img src=x onerror=alert(1)>'
python -m memray run -o poc.bin '<img src=x onerror=alert(1)>'
Generate a report:
python -m memray flamegraph -o poc.html poc.bin
Observed Result
The generated HTML contains raw unescaped attacker-controlled HTML.
Opening or reloading the generated report in a browser triggers JavaScript execution.
- Record
GHSA-r5pr-887v-m2w9- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
NVD
3.6
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
CVE-2026-32722- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSV
3.6
Memray-generated HTML reports vulnerable to Stored XSS via unescaped command-line metadata
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
CVE-2026-32722- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-32722
6.1
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
DEBIAN-CVE-2026-32722- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVGHSA-r5pr-887v-m2w9
3.6
Stored XSS in Memray-generated HTML reports via unescaped command-line metadata
Summary
Prior 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.
This allowed JavaScript execution when a victim opened the generated report in a browser.
Affected Version
- Memray version:
1.19.1and earlier
Remediation
Upgrade to Memray 1.19.2, and avoid attaching Memray to untrusted processes until you have upgraded.
Root Cause
Jinja 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.
Impact
An 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.
Note 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.
Proof of Concept
Run Memray on a script with an attacker-controlled filename:
touch '<img src=x onerror=alert(1)>'
python -m memray run -o poc.bin '<img src=x onerror=alert(1)>'
Generate a report:
python -m memray flamegraph -o poc.html poc.bin
Observed Result
The generated HTML contains raw unescaped attacker-controlled HTML.
Opening or reloading the generated report in a browser triggers JavaScript execution.
- Record
GHSA-r5pr-887v-m2w9- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - Weakness
- CWE-79
- Updated
- 2026-11-02
OSVPYSEC-2026-2203
6.1
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
PYSEC-2026-2203- CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-32722
3.6
Memray is a memory profiler for Python. Prior 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. This allowed JavaScript execution when a victim opened the generated report in a browser. Version 1.19.2 fixes the issue.
- Record
UBUNTU-CVE-2026-32722- CVSS 3.1
- 3.6 Low
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N - CVSS 3.1
- 6.1 Medium
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
memrayPyPI |
before 1.19.2 | 1.19.2 |
python-memrayDebian:13 |
before 1.17.0+dfsg-1+deb13u1, plus listed versions 1.17.0+dfsg-1 |
1.17.0+dfsg-1+deb13u1 |
python-memrayDebian:14 |
before 1.19.3+dfsg-1, plus listed versions 1.17.0+dfsg-1 |
1.19.3+dfsg-1 |
memrayPyPI |
before 1.19.2, plus listed versions 1.0.01.0.21.0.31.1.01.10.0 Show 28 moreShow less1.11.01.12.01.13.01.13.11.13.21.13.31.13.41.14.01.15.01.16.01.17.01.17.11.17.21.18.01.19.01.19.11.2.01.3.01.3.11.4.01.4.11.5.01.6.01.7.01.8.01.8.11.9.01.9.1 |
1.19.2 |
python-memrayUbuntu:25.10 |
All versions, plus listed versions 1.15.0+dfsg-11.17.0+dfsg-1 |
None known |
python-memrayUbuntu:26.10 |
All versions, plus listed versions 1.17.0+dfsg-1build1 |
None known |
python-memrayUbuntu:26.04:LTS |
All versions, plus listed versions 1.17.0+dfsg-11.17.0+dfsg-1build1 |
None known |
Public exploits
Links only. Every CVE stores no exploit code.
| Source | Link | Date |
|---|---|---|
| PoC in GitHub | 0xmrma/CVE-2026-32722 | 2026-03-15 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV, PoC in GitHub |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-32722 is a low vulnerability (CVSS 3.6) in Bloomberg Memray, published March 16, 2026. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 0.32%, the 25th percentile. Fixed in memray 1.19.2.
References
github.com/bloomberg/memray/security/advisories/GHSA-r5pr-887v-m2w9
github.com/bloomberg/memray/commit/ba6e4e2e9930f9641bed7adfdf43c8e2545ce249
github.com/bloomberg/memray/releases/tag/v1.19.2
nvd.nist.gov/vuln/detail/CVE-2026-32722
github.com/advisories/GHSA-r5pr-887v-m2w9
github.com/CVEProject/cvelistV5/tree/main/cves/2026/32xxx/CVE-2026-32722.json