python-dotenv — security advisory
python-dotenv reads key-value pairs from a .env file and can set them as environment variables. Prior to version 1.2.2, `set_key()` and `unset_key()` in python-dotenv follow symbolic links when rewriting `.env` files, allowing a local attacker to overwrite arbitrary files via a crafted symlink when a cross-device rename fallback is triggered. Users should upgrade to v.1.2.2 or, as a workaround, apply the patch manually.
- Products
- python-dotenv
- Affected versions
- 0.15.0-1, 0.19.0-1, 0.19.2-1, 0.7.1-1.1, 0.9.1-1, 1.0.0-1, 1.0.1-1, 1.0.1-1build1, 1.2.1-2
- Fixed versions
- Not specified
- CVEs
- CVE-2026-28684
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 02:06 UTC · Revision 1
Source evidence
python-dotenv reads key-value pairs from a .env file and can set them as environment variables. Prior to version 1.2.2, `set_key()` and `unset_key()` in python-dotenv follow symbolic links when rewriting `.env` files, allowing a local attacker to overwrite arbitrary files via a crafted symlink when a cross-device rename fallback is triggered. Users should upgrade to v.1.2.2 or, as a workaround, apply the patch manually.
osv:UBUNTU-CVE-2026-28684
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
python-dotenv
Fixed versions: Not specified
Complete source record
{
"id": "d67cb4a02217437aa17047633edc329e4c0d13b1ded3e53f17aac8126683793b",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2026-28684",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2026-28684",
"summary": "python-dotenv reads key-value pairs from a .env file and can set them as environment variables. Prior to version 1.2.2, `set_key()` and `unset_key()` in python-dotenv follow symbolic links when rewriting `.env` files, allowing a local attacker to overwrite arbitrary files via a crafted symlink when a cross-device rename fallback is triggered. Users should upgrade to v.1.2.2 or, as a workaround, apply the patch manually.",
"evidence": "osv:UBUNTU-CVE-2026-28684",
"products": [
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.7.1-1.1",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.9.1-1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.15.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "0.19.0-1",
"evidence": "/affected/2/versions"
},
{
"value": "0.19.2-1",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.0.0-1",
"evidence": "/affected/3/versions"
},
{
"value": "1.0.1-1",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.0.1-1",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.0.1-1build1",
"evidence": "/affected/5/versions"
},
{
"value": "1.2.1-2",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "python-dotenv",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "1.0.1-1",
"evidence": "/affected/6/versions"
},
{
"value": "1.0.1-1build1",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "medium",
"structured": {
"id": "UBUNTU-CVE-2026-28684",
"aliases": [
"UBUNTU-CVE-2026-28684"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:N/I:H/A:H"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=bionic",
"ecosystem": "Ubuntu:18.04:LTS"
},
"versions": [
"0.7.1-1.1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "0.7.1-1.1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"0.9.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "0.9.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"0.15.0-1",
"0.19.0-1",
"0.19.2-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "0.19.2-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"1.0.0-1",
"1.0.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "1.0.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"1.0.1-1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "1.0.1-1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"1.0.1-1build1",
"1.2.1-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "1.2.1-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "python-dotenv",
"purl": "pkg:deb/ubuntu/python-dotenv?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"1.0.1-1",
"1.0.1-1build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2026/UBUNTU-CVE-2026-28684.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "python3-dotenv",
"binary_version": "1.0.1-1build1"
}
]
}
}
],
"modified": "2026-10-17T12:58:08.103490576Z",
"provider": "osv",
"upstream": [
"CVE-2026-28684"
],
"references": [
"https://ubuntu.com/security/CVE-2026-28684",
"https://www.cve.org/CVERecord?id=CVE-2026-28684",
"https://github.com/theskumar/python-dotenv/security/advisories/GHSA-mf9w-mj56-hr94"
]
},
"related_cves": [
{
"value": "CVE-2026-28684",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 358191,
"published_at": "2026-04-20T17:16:00+00:00"
}