in_forward: validate array size before accessing message mode fields#11851
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe forward protocol parser now checks that a message-mode array has at least three elements before treating element 2 as the payload; on failure it logs a warning, frees msgpack/unpacker and out_tag, and returns -1. ChangesForward protocol message validation
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Hi, thanks for your contributions. But we need to add Signed-off lines to display who had committed in each of commit. |
|
@TristanInSec would you please sign off the commits ? (DCO error / git commit -s ...) |
The forward protocol parser accesses root.via.array.ptr[2] when the second element is a positive integer or EXT type (message mode), but only checks that the array has at least 2 elements. A 2-element array [tag, integer] passes the size check but causes an out-of-bounds heap read when accessing index 2. Add a size >= 3 check before the message mode branch. Signed-off-by: Tristan <tristan@talencesecurity.com>
dea17b4 to
d12ecb3
Compare
The forward protocol parser accesses root.via.array.ptr[2] when the
second element is a positive integer or EXT type (message mode), but
only checks that the array has at least 2 elements. A 2-element array
[tag, integer] passes the size check but causes an out-of-bounds heap
read when accessing index 2.
Add a size >= 3 check before the message mode branch.
Summary by CodeRabbit