Commit 9f90586
authored
pull latest (#473)
* quick fix for serial
* CRITICAL: Fix heap buffer overflow in Message.cpp (CVE-class RCE)
Fixed critical heap buffer overflow vulnerability in setUint() and setText()
functions that allowed Remote Code Execution.
Root cause: Incorrect comparison of bits vs bytes in bounds checking.
- Buffer size: 128 bytes (data[128])
- MAX_AIS_LENGTH: 1024 bits (not bytes)
- Bug: Compared (length >> 3) bytes to 1024 bits
- Result: Allowed writing up to 1024 bytes into 128-byte buffer
- Overflow: Up to 896 bytes beyond buffer boundary
Attack vector:
1. Overflow corrupts adjacent heap objects (e.g., std::vector)
2. Overwrite internal pointers (_M_start, _M_finish)
3. Gain arbitrary read/write primitive
4. Achieve code execution via ROP/shellcode
Fix: Compare bits to bits instead of bytes to bits
- Line 298: if (length >= MAX_AIS_LENGTH) instead of if (length >> 3 >= MAX_AIS_LENGTH)
- Line 377: if (end >= MAX_AIS_LENGTH) instead of if (end >> 3 >= MAX_AIS_LENGTH)
Impact: Prevents heap corruption and remote code execution
Severity: CRITICAL1 parent ca31bfd commit 9f90586
File tree
0 file changed
+0
-0
lines changed0 file changed
+0
-0
lines changed
0 commit comments