{"schema":"threatline.record/2","record":{"id":"GHSA-f2hq-32vh-53cc","aliases":["GHSA-f2hq-32vh-53cc"],"summary":"postal-mime: Quadratic CPU consumption when decoding a header of many joinable RFC 2047 base64 encoded words","details":"### Impact\n\nDecoding a header that holds a long run of joinable RFC 2047 base64 encoded words, such as `=?utf-8?B?QUJD?=` repeated tens of thousands of times in a `Subject`, `From`, `To`, a filename or a description, took time quadratic in the number of words. The join check ran a regex over the text joined so far for every word, which flattens the accumulated string each time. A single well formed message of about 1.6 MB blocked the event loop for one to twenty seconds depending on the host, and inline `message/rfc822` parts multiplied the cost, since each nested message carried its own header budget.\n\nAny application that parses untrusted mail with postal-mime 3.0.0 through 4.0.7, including the exported `decodeWords()` helper, is affected. There is no confidentiality or integrity impact.\n\n### Patches\n\nFixed in 4.0.8. The pad check now tracks the last appended word instead of testing the joined text, so decoding is linear in the header length. The same release also counts the parts and header bytes of inline `message/rfc822` sub-messages against the limits of the message as a whole, counts every header line for at least 64 bytes of `maxHeadersSize`, and adds a scaling test that measures every stage of the parser at two input sizes.\n\n### Workarounds\n\nLower `maxHeadersSize` from its 2 MiB default to bound the cost per message, or parse untrusted mail in a worker that can be terminated.\n\n### Credits\n\nReported by Felipe Fernández.","categories":["Libraries & packages"],"product":"postal-mime","vendor":"","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-f2hq-32vh-53cc","source_modified_at":"2026-10-23T21:54:37Z","fetched_at":"2026-10-23T22:01:05.715934Z","package":{"ecosystem":"npm","name":"postal-mime"},"range":">= 3.0.0, < 4.0.8"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-f2hq-32vh-53cc","source_modified_at":"2026-10-23T22:00:03.736647172Z","fetched_at":"2026-10-23T22:01:05.715934Z","package":{"name":"postal-mime","ecosystem":"npm","purl":"pkg:npm/postal-mime"},"ranges":[{"type":"SEMVER","events":[{"introduced":"3.0.0"},{"fixed":"4.0.8"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-f2hq-32vh-53cc","source_modified_at":"2026-10-23T21:54:37Z","fetched_at":"2026-10-23T22:01:05.715934Z","package":{"ecosystem":"npm","name":"postal-mime"},"version":"4.0.8"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-f2hq-32vh-53cc","source_modified_at":"2026-10-23T22:00:03.736647172Z","fetched_at":"2026-10-23T22:01:05.715934Z","package":{"name":"postal-mime","ecosystem":"npm","purl":"pkg:npm/postal-mime"},"version":"4.0.8"}],"cvss":7.5,"severity":"High","kev":{"listed":false},"epss":{"probability":null,"percentile":null,"score_date":null},"published_at":"2026-10-23T21:54:36Z","modified_at":"2026-10-23T22:00:03.736647172Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-f2hq-32vh-53cc","fetched_at":"2026-10-23T22:01:05.715934Z","source_modified_at":"2026-10-23T21:54:37Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-f2hq-32vh-53cc","fetched_at":"2026-10-23T22:01:05.715934Z","source_modified_at":"2026-10-23T22:00:03.736647172Z"}],"sources":["GitHub Advisory Database","OSV"],"references":[{"url":"https://github.com/postalsys/postal-mime/security/advisories/GHSA-f2hq-32vh-53cc","source":"GitHub Advisory Database"},{"url":"https://github.com/postalsys/postal-mime/commit/9eb25a66bb3cc8b631421be651b9648796f19136","source":"GitHub Advisory Database"},{"url":"https://github.com/postalsys/postal-mime/releases/tag/v4.0.8","source":"GitHub Advisory Database"},{"url":"https://github.com/advisories/GHSA-f2hq-32vh-53cc","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-23T22:00:03.736647172Z","content_hash":"20cb38a27f48284334d89028c2d43ffea16d4aec91aedae78d413c501cd87141"}}
