{"schemaVersion":3,"id":"CVE-2021-36159","aliases":["ALPINE-CVE-2021-36159"],"status":"published","duplicateOf":null,"title":null,"description":"libfetch before 2021-07-26, as used in apk-tools, xbps, and other products, mishandles numeric strings for the FTP and HTTP protocols. The FTP passive mode implementation allows an out-of-bounds read because strtol is used to parse the relevant numbers into address bytes. It does not check if the line ends prematurely. If it does, the for-loop condition checks for the '\\0' terminator one byte too late.","dates":{"published":"2021-08-03T13:22:54.000Z","modified":"2024-08-04T00:47:43.816Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":9.1,"severity":"critical","version":"3.1","versionLabel":"v3.1","source":"NVD","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"OSV · Alpine","score":9.1,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","exploitability":10,"impact":8.7,"computed":true},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":9.1,"severity":"critical","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:H","exploitability":null,"impact":null,"computed":false},{"version":"2.0","versionLabel":"v2.0","source":"NVD","score":6.4,"severity":"medium","vector":"AV:N/AC:L/Au:N/C:P/I:N/A:P","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.02637,"percentile":0.85355,"severity":"low","asOf":"2026-10-20T00:00:00.000Z","change":{"pp":0,"baselineDate":"2026-09-20T00:00:00.000Z","baselineScore":0.02637},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02637,"percentile":0.85355}],"last30":[{"date":"2026-09-20T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.02637,"percentile":null},{"date":"2026-10-20T00:00:00.000Z","score":0.02637,"percentile":0.85355}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_3B3CA07302F12F88","name":"Exploit Reference (gitlab.alpinelinux.org)","source":"reference","url":"https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-125","name":"Out-of-bounds Read","description":"The product reads data past the end, or before the beginning, of the intended buffer.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/125.html"}],"affected":[{"vendor":"alpine","product":"apk-tools","name":"apk-tools","label":"apk-tools","ecosystem":"Alpine Linux","cpePart":null,"purl":"pkg:apk/alpine/apk-tools","purlType":"apk","versions":[{"text":"< 2.10.7-r0","noFixRecorded":false,"fixedIn":null},{"text":"< 2.12.6-r0","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2.10.7-r0 | < 2.12.6-r0","eol":null,"hubHref":null},{"vendor":"freebsd","product":"libfetch","name":"libfetch","label":"libfetch","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"< 2021-07-26","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 2021-07-26","eol":null,"hubHref":"/vendor/freebsd/libfetch"}],"affectedCount":2,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749","label":"gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10749","hostname":"gitlab.alpinelinux.org","tags":["X Refsource MISC","Exploit","Third Party Advisory"]},{"url":"https://github.com/freebsd/freebsd-src/commits/main/lib/libfetch","label":"github.com/freebsd/freebsd-src/commits/main/lib/libfetch","hostname":"github.com","tags":["X Refsource MISC","Patch","Third Party Advisory"]},{"url":"https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cdev.kafka.apache.org%3E","label":"lists.apache.org/thread.html/…","hostname":"lists.apache.org","tags":["Mailing List","X Refsource MLIST"]},{"url":"https://lists.apache.org/thread.html/r61db8e7dcb56dc000a5387a88f7a473bacec5ee01b9ff3f55308aacc%40%3Cusers.kafka.apache.org%3E","label":"lists.apache.org/thread.html/…","hostname":"lists.apache.org","tags":["Mailing List","X Refsource MLIST"]},{"url":"https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cusers.kafka.apache.org%3E","label":"lists.apache.org/thread.html/…","hostname":"lists.apache.org","tags":["Mailing List","X Refsource MLIST"]},{"url":"https://lists.apache.org/thread.html/rbf4ce74b0d1fa9810dec50ba3ace0caeea677af7c27a97111c06ccb7%40%3Cdev.kafka.apache.org%3E","label":"lists.apache.org/thread.html/…","hostname":"lists.apache.org","tags":["Mailing List","X Refsource MLIST"]},{"url":"https://security.alpinelinux.org/vuln/CVE-2021-36159","label":"security.alpinelinux.org/vuln/CVE-2021-36159","hostname":"security.alpinelinux.org","tags":["Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2021-08-03T13:22:54.000Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2024-08-04T00:47:43.816Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":70,"level":"high","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T17:06:27.066Z","stale":false,"partial":false}}