Vulnerabilities in pkg:pypi/ipython
PACKAGECVE-2022-21699 is a HIGH (CVSS 8.2) execution with unnecessary privileges vulnerability (CWE-279: Incorrect Execution-Assigned Permissions) affecting Ipython libraries in the PyPI ecosystem. The issue involves execution with unnecessary privileges in ipython. Remediation is available by upgrading affected packages to version 5.11, 7.16.3, 7.31.1, 8.0.1.
pkg:pypi/ipython
Vulnerability advisories affecting package pkg:pypi/ipython. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-pq7m-3gw7-gq5x | CVE-2022-21699 | HIGH | Execution with Unnecessary Privileges in ipython |
| GHSA-7fc2-rm35-2pp7 | CVE-2015-5607 | HIGH | IPython vulnerable to cross site request forgery (CSRF) |
| GHSA-29gw-9793-fvw7 | CVE-2023-24816 | LOW | IPython vulnerable to command injection via set_term_title |
| GHSA-75cw-5cgv-g853 | CVE-2014-3429 | HIGH | IPython Notebook vulnerable to improper validation of the origin of websocket requests |
| GHSA-q326-jhw3-699g | CVE-2015-4706 | MODERATE | Improper Neutralization of Input During Web Page Generation in IPython |
| GHSA-4vwq-x64q-j4cj | CVE-2015-6938 | MODERATE | Improper Neutralization of Input During Web Page Generation in Jupyter Notebook |
| GHSA-66gw-5xpf-gfp5 | CVE-2015-4707 | MODERATE | Improper Neutralization of Input During Web Page Generation in IPython |
| GHSA-92mr-v722-f48m | CVE-2015-7337 | CRITICAL | Improper Input Validation in Jupyter Notebook |
CVE-2022-21699 at a Glance
Security Impact
CVSS: 8.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H).
How to Fix CVE-2022-21699
To remediate this vulnerability, upgrade all affected Ipython 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 ipython>=5.11
pip install ipython>=7.16.3
pip install ipython>=7.31.1
pip install ipython>=8.0.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ipython
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-21699, inspect your installed packages using pip:
pip show ipython
Analyze the terminal output to locate any version of Ipython in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.11), your application is affected.
Note: The pip show ipython command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-279: Incorrect Execution-Assigned Permissions, where while it is executing, the product sets the permissions of an object in a way that violates the intended permissions that have been specified by the user. In Ipython, 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-2022-21699 Affected Ipython Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ipython
|
PyPI |
< 5.11
|
5.11
|
|
ipython
|
PyPI |
≥ 6.0.0
< 7.16.3
|
7.16.3
|
|
ipython
|
PyPI |
≥ 7.17.0
< 7.31.1
|
7.31.1
|
|
ipython
|
PyPI |
≥ 8.0.0
< 8.0.1
|
8.0.1
|
References
Frequently Asked Questions
What is CVE-2022-21699?
Which Ipython versions are affected?
What version fixes CVE-2022-21699?
Is ipython affected?
What is the CVSS score of CVE-2022-21699?
What CWE is associated with CVE-2022-21699?
How can I check PyPI dependencies for CVE-2022-21699?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-pq7m-3gw7-gq5x",
"modified" : "2024-09-27T17:22:07Z",
"published" : "2022-01-21T18:55:30Z",
"aliases" : [ "CVE-2022-21699" ],
"summary" : "Execution with Unnecessary Privileges in ipython",
"details" : "We’d like to disclose an arbitrary code execution vulnerability in IPython that stems from IPython executing untrusted files in CWD. This vulnerability allows one user to run code as another.\n \nProof of concept\n\nUser1:\n```\nmkdir -m 777 /tmp/profile_default\nmkdir -m 777 /tmp/profile_default/startup\necho 'print(\"stealing your private secrets\")' > /tmp/profile_default/startup/foo.py\n```\n\nUser2:\n```\ncd /tmp\nipython\n```\n\n \n\nUser2 will see:\n```\nPython 3.9.7 (default, Oct 25 2021, 01:04:21)\nType 'copyright', 'credits' or 'license' for more information\nIPython 7.29.0 -- An enhanced Interactive Python. Type '?' for help.\nstealing your private secrets\n```\n\n\n## Patched release and documentation\n\nSee https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-0-1-cve-2022-21699, \n\nVersion 8.0.1, 7.31.1 for current Python version are recommended. \nVersion 7.16.3 has also been published for Python 3.6 users, \nVersion 5.11 (source only, 5.x branch on github) for older Python versions.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ipython"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "5.11"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ipython"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "6.0.0"
}, {
"fixed" : "7.16.3"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ipython"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "7.17.0"
}, {
"fixed" : "7.31.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "PyPI",
"name" : "ipython"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "8.0.0"
}, {
"fixed" : "8.0.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/ipython/ipython/security/advisories/GHSA-pq7m-3gw7-gq5x"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-21699"
}, {
"type" : "WEB",
"url" : "https://github.com/ipython/ipython/commit/46a51ed69cdf41b4333943d9ceeb945c4ede5668"
}, {
"type" : "WEB",
"url" : "https://github.com/ipython/ipython/commit/5fa1e409d2dc126c456510c16ece18e08b524e5b"
}, {
"type" : "WEB",
"url" : "https://github.com/ipython/ipython/commit/67ca2b3aa9039438e6f80e3fccca556f26100b4d"
}, {
"type" : "WEB",
"url" : "https://github.com/ipython/ipython/commit/a06ca837273271b4acb82c29be97c0b6d12a30ea"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ipython/ipython"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ipython/PYSEC-2022-12.yaml"
}, {
"type" : "WEB",
"url" : "https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-0-1-cve-2022-21699"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2022/01/msg00021.html"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CRQRTWHYXMLDJ572VGVUZMUPEOTPM3KB"
}, {
"type" : "WEB",
"url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DZ7LVZBB4D7KVSFNEQUBEHFO3JW6D2ZK"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-250", "CWE-269", "CWE-279" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-19T21:26:17Z",
"nvd_published_at" : "2022-01-19T22:15:00Z"
}
}