{"id":"CVE-2025-30216","published":"2025-03-25T19:22:22Z","modified":"2025-03-25T19:37:44Z","title":"CryptoLib Has Heap Overflow in Crypto_TM_ProcessSecurity due to Unchecked Secondary Header Length","vendor":"nasa","product":"CryptoLib","tier":"tail","description":{"text":"CryptoLib provides a software-only solution using the CCSDS Space Data Link Security Protocol - Extended Procedures (SDLS-EP) to secure communications between a spacecraft running the core Flight System (cFS) and a ground station. In versions 1.3.3 and prior, a Heap Overflow vulnerability occurs in the `Crypto_TM_ProcessSecurity` function (`crypto_tm.c:1735:8`). When processing the Secondary Header Length of a TM protocol packet, if the Secondary Header Length exceeds the packet's total length, a heap overflow is triggered during the memcpy operation that copies packet data into the dynamically allocated buffer `p_new_dec_frame`. This allows an attacker to overwrite adjacent heap memory, potentially leading to arbitrary code execution or system instability. A patch is available at commit 810fd66d592c883125272fef123c3240db2f170f.","provenance":"source","from":"CVE.org"},"cvss":{"score":9.4,"severity":"CRITICAL","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.0265,"percentile":0.86006,"provenance":"source"},"cwes":[{"id":"CWE-122","name":"Heap-based Buffer Overflow"}],"references":[{"url":"https://github.com/nasa/CryptoLib/security/advisories/GHSA-v3jc-5j74-hcjv","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/nasa/CryptoLib/commit/810fd66d592c883125272fef123c3240db2f170f","tags":["x_refsource_MISC"]},{"url":"https://github.com/user-attachments/assets/d49cea04-ce84-4d60-bb3a-987e843f09c4","tags":["x_refsource_MISC"]}],"priority":{"score":28.8,"factors":[{"name":"EPSS percentile","points":17.2},{"name":"Public exploit code","points":5.0},{"name":"CVSS severity","points":6.58}]},"exploitSources":{"pocGithub":{"count":1,"skipped":0,"earliest":"2025-03-26","earliestUrl":"https://github.com/oliviaisntcringe/CVE-2025-30216-PoC","repos":[{"name":"oliviaisntcringe/CVE-2025-30216-PoC","url":"https://github.com/oliviaisntcringe/CVE-2025-30216-PoC","stars":0,"created":"2025-03-26"}]},"first":{"date":"2025-03-26","source":"PoC-in-GitHub","url":"https://github.com/oliviaisntcringe/CVE-2025-30216-PoC"},"provenance":"source"},"vendorSlug":"nasa","affectedVersions":[{"vendor":"nasa","product":"CryptoLib","versions":["<= 1.3.3"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"total","timestamp":"2025-03-25T19:37:16.643373Z","from":"CISA ADP","provenance":"source"},"euvd":{"id":"EUVD-2025-8083","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-nasa-cryptolib-cve-2025-29909","parents":[{"from":"CVE-2025-29909","to":"CVE-2025-30216","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/core/crypto_tc.c"],"commits":["https://github.com/nasa/CryptoLib/commit/c7e8a8745ff4b5e9bd7e500e91358e86d5abedcc","https://github.com/nasa/CryptoLib/commit/810fd66d592c883125272fef123c3240db2f170f"],"basis":"shared function","functions":["Crypto_TC_ProcessSecurity_Cam"]}]},{"from":"CVE-2025-29912","to":"CVE-2025-30216","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["src/core/crypto_tc.c"],"commits":["https://github.com/nasa/CryptoLib/commit/ca39cb96f21e76102aefb956d2c8c0ba0bd143ca","https://github.com/nasa/CryptoLib/commit/810fd66d592c883125272fef123c3240db2f170f"],"basis":"shared function","functions":["Crypto_TC_ProcessSecurity_Cam"]}]}],"children":[{"from":"CVE-2025-30216","to":"CVE-2025-30356","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["include/crypto_error.h","src/core/crypto_error.c","src/core/crypto_tc.c"],"commits":["https://github.com/nasa/CryptoLib/commit/810fd66d592c883125272fef123c3240db2f170f","https://github.com/nasa/CryptoLib/commit/59d1bce7608c94c6131ef4877535075b0649799c"],"basis":"shared function","functions":["Crypto_TC_ProcessSecurity_Cam"]}]},{"from":"CVE-2025-30216","to":"CVE-2025-54878","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["include/crypto_config.h","include/crypto_error.h","src/core/crypto_error.c","src/core/crypto_tc.c","src/core/crypto_tm.c"],"commits":["https://github.com/nasa/CryptoLib/commit/810fd66d592c883125272fef123c3240db2f170f","https://github.com/nasa/CryptoLib/commit/9b5b294ec09da450d2d4d05aea2db604ead48be1"],"basis":"shared function","functions":["Crypto_TM_ApplySecurity","Crypto_TM_ProcessSecurity","Crypto_TM_Process_Setup"]}]}]}}