docopt.cpp — security advisory
A signed integer overflow in docopt.cpp v0.6.2 (LeafPattern::match in docopt_private.h) when merging occurrence counters (e.g., default LONG_MAX + first user "-v/--verbose") can cause counter wrap (negative/unbounded semantics) and lead to logic/policy bypass in applications that rely on occurrence-based limits, rate-gating, or safety toggles. In hardened builds (e.g., UBSan or -ftrapv), the overflow may also result in process abort (DoS).
- Products
- docopt.cpp
- Affected versions
- 0.6.2-2, 0.6.2-2.1, 0.6.2-2.3, 0.6.2-2.4, 0.6.2-2build1, 0.6.3-4, 0.6.3-4build1, 0.6.3-5, 0.6.3-5build1
- Fixed versions
- Not specified
- CVEs
- CVE-2025-67125
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 01:55 UTC · Revision 1
Source evidence
A signed integer overflow in docopt.cpp v0.6.2 (LeafPattern::match in docopt_private.h) when merging occurrence counters (e.g., default LONG_MAX + first user "-v/--verbose") can cause counter wrap (negative/unbounded semantics) and lead to logic/policy bypass in applications that rely on occurrence-based limits, rate-gating, or safety toggles. In hardened builds (e.g., UBSan or -ftrapv), the overflow may also result in process abort (DoS).
osv:UBUNTU-CVE-2025-67125
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
docopt.cpp
Fixed versions: Not specified
Complete source record
{
"id": "a34c2faa281b2a7fcf7898f21883be124f61949a23240d1d78e690f936c1a145",
"url": "https://osv.dev/vulnerability/UBUNTU-CVE-2025-67125",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "UBUNTU-CVE-2025-67125",
"summary": "A signed integer overflow in docopt.cpp v0.6.2 (LeafPattern::match in docopt_private.h) when merging occurrence counters (e.g., default LONG_MAX + first user \"-v/--verbose\") can cause counter wrap (negative/unbounded semantics) and lead to logic/policy bypass in applications that rely on occurrence-based limits, rate-gating, or safety toggles. In hardened builds (e.g., UBSan or -ftrapv), the overflow may also result in process abort (DoS).",
"evidence": "osv:UBUNTU-CVE-2025-67125",
"products": [
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/0/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.2-2",
"evidence": "/affected/0/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/1/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.2-2",
"evidence": "/affected/1/versions"
},
{
"value": "0.6.2-2build1",
"evidence": "/affected/1/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/2/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.2-2.1",
"evidence": "/affected/2/versions"
},
{
"value": "0.6.2-2.3",
"evidence": "/affected/2/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/3/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.2-2.4",
"evidence": "/affected/3/versions"
},
{
"value": "0.6.3-4",
"evidence": "/affected/3/versions"
},
{
"value": "0.6.3-4build1",
"evidence": "/affected/3/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/4/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.3-5",
"evidence": "/affected/4/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/5/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.3-5build1",
"evidence": "/affected/5/versions"
}
]
},
{
"name": {
"value": "docopt.cpp",
"evidence": "/affected/6/package/name"
},
"prerequisites": [],
"fixed_versions": [],
"affected_versions": [
{
"value": "0.6.3-5",
"evidence": "/affected/6/versions"
},
{
"value": "0.6.3-5build1",
"evidence": "/affected/6/versions"
}
]
}
],
"severity": "medium",
"structured": {
"id": "UBUNTU-CVE-2025-67125",
"aliases": [
"UBUNTU-CVE-2025-67125"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:L"
},
{
"type": "Ubuntu",
"score": "medium"
}
],
"affected": [
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=bionic",
"ecosystem": "Ubuntu:18.04:LTS"
},
"versions": [
"0.6.2-2"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.2-2"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=focal",
"ecosystem": "Ubuntu:20.04:LTS"
},
"versions": [
"0.6.2-2",
"0.6.2-2build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.2-2build1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=jammy",
"ecosystem": "Ubuntu:22.04:LTS"
},
"versions": [
"0.6.2-2.1",
"0.6.2-2.3"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.2-2.3"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=noble",
"ecosystem": "Ubuntu:24.04:LTS"
},
"versions": [
"0.6.2-2.4",
"0.6.3-4",
"0.6.3-4build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.3-4build1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=questing",
"ecosystem": "Ubuntu:25.10"
},
"versions": [
"0.6.3-5"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.3-5"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=stonking",
"ecosystem": "Ubuntu:26.10"
},
"versions": [
"0.6.3-5build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.3-5build1"
}
]
}
},
{
"ranges": [
{
"type": "ECOSYSTEM",
"events": [
{
"introduced": "0"
}
]
}
],
"package": {
"name": "docopt.cpp",
"purl": "pkg:deb/ubuntu/docopt.cpp?arch=source&distro=resolute",
"ecosystem": "Ubuntu:26.04:LTS"
},
"versions": [
"0.6.3-5",
"0.6.3-5build1"
],
"database_specific": {
"source": "https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2025/UBUNTU-CVE-2025-67125.json"
},
"ecosystem_specific": {
"binaries": [
{
"binary_name": "libdocopt0",
"binary_version": "0.6.3-5build1"
}
]
}
}
],
"modified": "2026-10-17T12:57:38.129961653Z",
"provider": "osv",
"upstream": [
"CVE-2025-67125"
],
"references": [
"https://ubuntu.com/security/CVE-2025-67125",
"https://www.cve.org/CVERecord?id=CVE-2025-67125",
"https://gist.github.com/thesmartshadow/672afe8828844c833f46f8ebe2f5f3bd",
"https://github.com/docopt/docopt.cpp"
]
},
"related_cves": [
{
"value": "CVE-2025-67125",
"evidence": "/upstream"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 357654,
"published_at": "2026-01-23T16:15:00+00:00"
}