Integer Overflow to Heap Buffer Overflow in NASA ION-DTN startImportSession — libltpP.c:5781
An integer overflow in NASA ION-DTN's startImportSession() causes a heap buffer to be allocated with a drastically undersized value (16 bytes instead of ~4 GB), leading to a heap buffer overflow write of 84 bytes when a subsequent data segment is processed. An unauthenticated attacker with UDP access to the ION-DTN LTP port can trigger this with two crafted packets.
- Accepted in 2 months
- Fixed in 2 months
- Disclosed after 2 months
Summary by Excal1bur
An integer overflow in NASA ION-DTN's startImportSession() causes a heap buffer to be allocated with a drastically undersized value (16 bytes instead of ~4 GB), leading to a heap buffer overflow WRITE of 84 bytes when a subsequent data segment is processed. An unauthenticated attacker with UDP access to the ION-DTN LTP port (default 1113) can trigger this with two crafted packets.
Affected Components
| File | Line | CWE |
1 | ltp/library/libltpP.c | 5781 | CWE-190 (Integer Overflow) |
2 | ici/library/ion.c | 1737 | CWE-197 (Numeric Truncation Error) |
Issue 1 — Integer Overflow → Heap Buffer Overflow (libltpP.c:5781)
Root Cause
uvast blockSize = pdu->offset + pdu->length;
// Both fields are uint32 — wraps before widening to uint64
// offset=0xFFFFFFF0 + length=0x00000020 = 0x10 (16) instead of ~4GB
Proof of Concept
Packet 1 — LTP Red EOB (UDP :1113):
offset=0xFFFFFFF0, length=0x00000020
→ blockSize = 16 (integer overflow)
→ importBuffer = sdr_malloc(sdr, 16)
Packet 2 — Normal LTP data segment:
offset=0, length=100
→ sdr_write(heapBufferObj + 16, data, 84) ← OOB WRITE
ASAN Output
ERROR: AddressSanitizer: heap-buffer-overflow
WRITE of size 84 at 0x6e3562be0020
#1 simulate_startImportSession harness_ion_dtn_ltp_overflow.c:161
0x6e3562be0020 is located 0 bytes after 16-byte region
Fix Applied
uvast blockSize = (uvast)pdu->offset + (uvast)pdu->length;
Issue 2 — SDNV Integer Truncation (ion.c:1737)
Root Cause
*into = val; /* Truncate. */
// val=uvast (uint64_t), *into=uint32_t — no bounds check
// 0x100000001 → *into = 1, 4GB silently lost
Fix Applied
if (val > UINT_MAX) {
writeMemoNote("[?] SDNV value exceeds uint32", NULL);
return 0;
}
*into = (unsigned int)val;
Impact
ION-DTN has been operational on the International Space Station since 2016 and is the reference DTN implementation used by NASA JPL and ESA OPS-SAT. On flight hardware without ASLR/DEP (VxWorks, RTEMS), a controlled heap overflow reachable via unauthenticated UDP could allow arbitrary code execution through the ground-to-spacecraft link.
The attacker requires UDP access to the LTP port — achievable from a compromised ground station, a co-located experiment on the ISS network, or a mission integration/test environment.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the sum of two 32-bit fields (offset and length) overflows before being widened to 64 bits, producing a small block size.
Impact
On flight hardware without ASLR/DEP, a controlled heap overflow reachable via unauthenticated UDP could allow arbitrary code execution through the ground-to-spacecraft link.
What the attacker needed
UDP access to the LTP port (default 1113); Ability to send crafted LTP packets
The fix
The fix casts the offset and length to a 64-bit type before addition, preventing the overflow.
How it was found
- Send a crafted LTP Red EOB packet with offset and length values that overflow to a small block size.
- The program allocates a 16-byte buffer instead of the intended ~4 GB.
- Send a normal LTP data segment with offset 0 and length 100.
- The program writes 84 bytes past the end of the 16-byte buffer, causing a heap buffer overflow.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This report describes a bug in software used for space communications. A number is added together in a way that wraps around to a tiny value, so the program reserves far too little memory. Later, when more data arrives, it writes past the end of that small memory area, which can crash the program or let an attacker run their own code.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.