fix: restore description_length cap in V2 register_application and register_context#876
Open
IanYHChu wants to merge 1 commit into
Open
fix: restore description_length cap in V2 register_application and register_context#876IanYHChu wants to merge 1 commit into
IanYHChu wants to merge 1 commit into
Conversation
…gister_context The DLTv2 IPC registration handlers have their description_length sanity guards commented out, while the equivalent V1 code paths apply them correctly. This allows an attacker-controlled description_length (uint32) to be passed directly to dlt_receiver_check_and_get, which calls memcpy into a 257-byte stack buffer (description[DLT_DAEMON_DESCSIZE + 1]), causing a stack buffer overflow. Uncomment the existing guards in both V2 code paths to clamp description_length to DLT_DAEMON_DESCSIZE (256). Affected functions: - dlt_daemon_process_user_message_register_application (V2 branch, ~line 4012) - dlt_daemon_process_user_message_register_context (V2 branch, ~line 4301) Signed-off-by: Ian Chu <ian_chu@vicone.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Uncomment the
description_lengthsanity guards in the two DLTv2 IPC registrationhandlers that were accidentally left commented out during the V2 upgrade series.
Without these guards, an attacker-controlled
description_length(uint32) is passeddirectly to
dlt_receiver_check_and_get, which callsmemcpyinto a 257-byte stackbuffer (
description[DLT_DAEMON_DESCSIZE + 1]), causing a stack buffer overflow.The equivalent V1 code paths at lines ~4116 and ~4540 apply the cap correctly.
Changes
dlt_daemon_process_user_message_register_application(V2 branch, line ~4012):Uncomment
if (len > DLT_DAEMON_DESCSIZE)guarddlt_daemon_process_user_message_register_context(V2 branch, line ~4301):Uncomment
if (len > DLT_DAEMON_DESCSIZE)guardTesting
Closes #875