Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL byte overflow in dlt_message_argument_print #616

Open
jch6637 opened this issue Mar 29, 2024 · 0 comments
Open

NULL byte overflow in dlt_message_argument_print #616

jch6637 opened this issue Mar 29, 2024 · 0 comments

Comments

@jch6637
Copy link

jch6637 commented Mar 29, 2024

Summary

A buffer overflow vulnerability exists in the DLT_MSG_READ_STRING function called by the dlt_message_argument_print function.
NULL byte overflow occurs when copying a string of DLT_CONVERT_TEXTBUFSIZE (10024) length.

Details

  1. Execute dlt-convert with the -a argument, using a DLT file containing a string of length DLT_CONVERT_TEXTBUFSIZE
  2. The functions are called in the following sequence:
    dlt_message_payload -> dlt_message_argument_print -> DLT_MSG_READ_STRING
  3. After the execution of memcpy and dlt_clean_string functions, the statement dst[length] = 0 is executed, resulting in a NULL byte overflow
    (https://github.com/COVESA/dlt-daemon/blob/master/include/dlt/dlt_common.h#L323)

Test environment

  • OS: Ubuntu 22.04
  • gcc: 11.4.0
  • DLT Package Version: 2.18.10 STABLE
  • Package Revision: v2.18.10_34_ga465513

Attachment

Attachment.zip
Attaching the DLT file capable of triggering the vulnerability and the ASAN report.
The vulnerability can be reproduced by executing the command dlt-convert -a ./poc.dlt.

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

No branches or pull requests

1 participant