# CVE-2026-4786: Python CPython command injection bypass in webbrowser module

Source: https://junglewise.ai/threats/cve-2026-4786-python-cpython-command-injection-bypass-in-webbrowser-module  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-04-13. Updated: 2026-06-30  
License: CC BY 4.0 with a link back

CVE-2026-4786 · Severity: high · CVSS 7.1 · Published 2026-04-13

A vulnerability in the Python standard library's 'webbrowser' module could allow an attacker to execute unauthorized commands on a user's system. This occurs when a specially crafted URL is opened, bypassing previous security fixes intended to prevent malicious command injection. If an application uses this module to open links provided by users, it could lead to a full system compromise or unauthorized data access.

Technologies: [Python Software Foundation CPython](https://junglewise.ai/threats/technologies/cpython). Vendors: [Python Software Foundation](https://junglewise.ai/threats/vendors/python-software-foundation).

## Quick answers

**Is CVE-2026-4786 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-4786 being exploited in the wild.

**How severe is CVE-2026-4786?** High severity, with a CVSS score of 7.1, published 13 April 2026.

**Which products and versions are affected?** Python Software Foundation CPython 3.10, 3.11, 3.12, 3.13, 3.14.

**Is there a fix for CVE-2026-4786?** A patch was published on 2026-04-13: Fixes merged into CPython main branch Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-4786 attacked?** It is attacked with local access or over the network, in a software library.

**Am I affected by CVE-2026-4786?** Check whether you run Python Software Foundation CPython at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

This vulnerability is a regression or incomplete fix for CVE-2026-4519 within the CPython 'webbrowser' module. The original mitigation intended to prevent command injection by checking for dash-prefixed arguments that could be interpreted as shell flags; however, this check could be bypassed if a URL contained the '%action' string. When the 'webbrowser.open()' API is called, an attacker can inject arbitrary commands into the underlying shell on certain browser types. The issue affects multiple active CPython branches including 3.10 through 3.14. Patches have been developed to properly sanitize the '%action' substitution and enforce dash-prefix restrictions.

## Affected products

- Python Software Foundation CPython 3.10, 3.11, 3.12, 3.13, 3.14

## Timeline

- 2026-03-31: other: Initial fix developed in CPython repository
- 2026-04-06: disclosed: Issue reported on GitHub and PRs opened
- 2026-04-13: patched: Fixes merged into CPython main branch
- 2026-04-13: advisory: NVD advisory published

## References

- [https://github.com/python/cpython/commit/28b4ad38067bbdad34edfcd03ad2de5f06387e53](https://github.com/python/cpython/commit/28b4ad38067bbdad34edfcd03ad2de5f06387e53)
- [https://github.com/python/cpython/commit/c5767a72838a8dda9d6dc5d3558075b055c56bca](https://github.com/python/cpython/commit/c5767a72838a8dda9d6dc5d3558075b055c56bca)
- [https://github.com/python/cpython/commit/d22922c8a7958353689dc4763dd72da2dea03fff](https://github.com/python/cpython/commit/d22922c8a7958353689dc4763dd72da2dea03fff)
- [https://github.com/python/cpython/commit/d6d68494be70bdbda20f89f83801ba52ec37daa4](https://github.com/python/cpython/commit/d6d68494be70bdbda20f89f83801ba52ec37daa4)
- [https://github.com/python/cpython/commit/f4654824ae0850ac87227fb270f9057477946769](https://github.com/python/cpython/commit/f4654824ae0850ac87227fb270f9057477946769)
- [https://github.com/python/cpython/issues/148169](https://github.com/python/cpython/issues/148169)
- [https://github.com/python/cpython/pull/148170](https://github.com/python/cpython/pull/148170)

## Related threats

- [Python gzip/tarfile/zipfile CLI module shadowing via sys.path](https://junglewise.ai/threats/cve-2026-115791-when-tarfile-or-zipfile-command-line-interface-cli-is-used-to)
- [Python CPython quadratic complexity in xml.etree XPath index predicates](https://junglewise.ai/threats/cve-2026-6879-python-cpython-quadratic-complexity-in-xml-etree-xpath-index)
- [Python CPython CPU denial of service in html.parser.HTMLParser](https://junglewise.ai/threats/cve-2026-15308-python-cpython-cpu-denial-of-service-in-html-parser-htmlparser)
- [Python CPython improper permission preservation in tarfile.extract](https://junglewise.ai/threats/cve-2026-4360-python-cpython-improper-permission-preservation-in-tarfile-extract)
- [Python CPython infinite loop in tarfile streaming mode](https://junglewise.ai/threats/cve-2026-11972-python-cpython-infinite-loop-in-tarfile-streaming-mode)
