Skip to content

fix: restore description_length cap in V2 register_application and register_context#876

Open
IanYHChu wants to merge 1 commit into
COVESA:masterfrom
IanYHChu:fix/dltv2-description-length-overflow
Open

fix: restore description_length cap in V2 register_application and register_context#876
IanYHChu wants to merge 1 commit into
COVESA:masterfrom
IanYHChu:fix/dltv2-description-length-overflow

Conversation

@IanYHChu
Copy link
Copy Markdown

Summary

Uncomment the description_length sanity guards in the two DLTv2 IPC registration
handlers that were accidentally left commented out during the V2 upgrade series.

Without these guards, an attacker-controlled description_length (uint32) is 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.

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) guard
  • dlt_daemon_process_user_message_register_context (V2 branch, line ~4301):
    Uncomment if (len > DLT_DAEMON_DESCSIZE) guard

Testing

  • ASAN build: stack-buffer-overflow crash eliminated on both sites
  • Daemon operates normally with warning logged for oversized descriptions
  • V1 code paths unaffected (they already have the guard active)

Closes #875

…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stack buffer overflow in DLTv2 IPC handlers — description_length cap commented out

1 participant