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

[Bug] There is a potential buffer overflow vulnerability in the logger module #23258

Closed
zhangteng0526 opened this issue Jun 12, 2024 · 0 comments

Comments

@zhangteng0526
Copy link
Contributor

Describe the bug

https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/logger/logged_topics.cpp#L440
If "topic_name" is too long, it may lead to potential buffer overflow vulnerability

To Reproduce

Although I did not reproduce it, here are my ideas for reproducing it

  1. In https://github.com/PX4/PX4-Autopilot/blob/main/src/modules/logger/logged_topics.cpp#L561, it is specified to read from the /etc/logging/logger_topics.txt file
  2. In the above file, set topic_name to be very long (>80)
  3. Start the drone software-in-the-loop simulation/hardware-in-the-loop simulation/real flight
  4. Check the error

Expected behavior

If it is software simulation, starting it under PX4_ASAN conditions will cause the simulation to crash instantly

Screenshot / Media

None

Flight Log

None

Software Version

v1.14.3

Flight controller

NONE

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant