# CVE-2026-4786: Incomplete mitigation of CVE-2026-4519, %action expansion for command injection to webbrowser.open()

> Attackers can inject shell commands via webbrowser.open() when URLs contain %action, bypassing previous mitigations in the Python standard library.

- **Severity:** High 7.0 (`CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 13 Apr 2026
- **Updated:** 13 Aug 2026
- **Also known as:** ALPINE-CVE-2026-4786, AZL-83054, BELL-CVE-2026-4786, BIT-libpython-2026-4786, BIT-python-2026-4786, BIT-python-min-2026-4786, CLSA-2026-1777660095, CLSA-2026-1777883384, CLSA-2026-1777884819, CLSA-2026-1777891107, DEBIAN-CVE-2026-4786, GHSA-cccx-m78h-m3xw, MINI-5xc7-6xpr-mx9r, MINI-7vqq-2q9w-c3cg, MINI-j6gj-hmrf-m7hq, MINI-pgh4-63g8-cmpw, MINI-xcjf-w62x-cpvg, PSF-0000-CVE-2026-4786, PSF-2026-17, RHSA-2026:19589, RHSA-2026:22144, RHSA-2026:35838, ROOT-OS-ALPINE-320-CVE-2026-4786, UBUNTU-CVE-2026-4786

## What is CVE-2026-4786?

CVE-2026-4786 is a high-severity command injection vulnerability in CPython, published on 13 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### Official description

Mitgation of CVE-2026-4519 was incomplete. If the URL contained "%action" the mitigation could be bypassed for certain browser types the "webbrowser.open()" API could have commands injected into the underlying shell. See CVE-2026-4519 for details.

Weakness: CWE-88 (Improper Neutralization of Argument Delimiters in a Command), CWE-77 (Improper Neutralization of Special Elements used in a Command)

## Which versions are affected by CVE-2026-4786?

3 open source packages ship an affected version, including libpython, python and python-min.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `libpython` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5 |
| `python` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5 |
| `python-min` | Bitnami | All versions | 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5 |
| `python` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python-debuginfo` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python-devel` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python-libs` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python-test` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python-tools` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `tkinter` | Red Hat:rhel_els:6 | All versions | 0:2.6.6-70.el6_10.4 |
| `python` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-debug` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-debuginfo` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-devel` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-libs` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-test` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python-tools` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |
| `python3` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-debug` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-debuginfo` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-devel` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-idle` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-libs` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-test` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `python3-tkinter` | Red Hat:rhel_els:7 | All versions | 0:3.6.8-21.el7_9.6 |
| `tkinter` | Red Hat:rhel_els:7 | All versions | 0:2.7.5-94.el7_9.5 |

## How do I fix CVE-2026-4786?

Upgrade libpython to a fixed version for your release line: 3.10.21, 3.11.16, 3.12.14 or 3.13.14.

## Is CVE-2026-4786 being exploited?

There is no known exploitation of CVE-2026-4786 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-4786 and fix it if it is affected.

What it is: CVE-2026-4786 is a high-severity command injection vulnerability in CPython, published on 13 Apr 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-4786 in the wild and no public exploit code.

Affected packages and fixed versions:
- libpython (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5
- python (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5
- python-min (Bitnami): affected all versions; fixed in 3.10.21, 3.11.16, 3.12.14, 3.13.14, 3.14.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-4786/ (Markdown: https://insights.sbomify.com/CVE-2026-4786/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-4786
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-4786
- OSV: https://osv.dev/vulnerability/CVE-2026-4786

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-4786/
Summaries are generated and may contain mistakes; the official description above is the record.
