-
Notifications
You must be signed in to change notification settings - Fork 788
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
Assertion failure in SequenceNumber.h via malformed SPDP packet only when compiled in logging-enabled (Debug) mode #3236
Comments
[Update] sharing my analysis. Seems like the culprit is the compiler optimization. The heartbeat submessage has bad sequence numbers, i.e.,
The sanity check line at MessageReceiver.cpp:1057, invokes the
in which However, when built with default config using |
@squizz617 Thank you for the report and the analysis. We will try to have a regression test and a fix. I think that MessageReceiver should first check that the received sequences are valid (i.e. they have a positive high part), and then check for |
Hi @MiguelCompany, thank you for your reply.
I agree. Having a validity check on
|
Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue eProsima#3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com>
Signed-off-by: Seulbae Kim <squizz617@gmail.com>
* Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com>
* Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0)
* Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0)
* Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0)
* Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0) Co-authored-by: Seulbae Kim <squizz617@gmail.com>
* Implement a validity check for firstSN (#3274) * Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0) * Refs #17717: Logging Macro fix Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> Co-authored-by: Seulbae Kim <squizz617@gmail.com> Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
* Implement a validity check for firstSN (#3274) * Implement a validity check for firstSN Following 8.3.8.6.3 of DDS-RTPS 2.5. This fixes issue #3236. Signed-off-by: Seulbae Kim <squizz617@gmail.com> * fix typo Signed-off-by: Seulbae Kim <squizz617@gmail.com> * add test input for issue #3236 (pr #3274) Signed-off-by: Seulbae Kim <squizz617@gmail.com> --------- Signed-off-by: Seulbae Kim <squizz617@gmail.com> (cherry picked from commit 3aa3ee0) * Refs #17717: Logging Macro fix Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> --------- Signed-off-by: Mario Dominguez <mariodominguez@eprosima.com> Co-authored-by: Seulbae Kim <squizz617@gmail.com> Co-authored-by: Mario Dominguez <mariodominguez@eprosima.com>
Hi @MiguelCompany, could you assign a CVE ID for this issue? A relevant CWE would be CWE-617: Reachable Assertion. |
CVE-2023-39949 appears to have been assigned for this issue. |
Is there an already existing issue for this?
Expected behavior
Malformed submessages handled gracefully.
Current behavior
I came across two following issues.
fastrtps/include/fastdds/rtps/common/SequenceNumber.h:247
.Steps to reproduce
Launch
DDSHelloWorldExample
with logging and send the malformed packet239.255.0.1:7400
):Assertion failure has been triggered!
Launch
DDSHelloWorldExample
without logging and send the malformed packetSend the same SPDP packet
Result after sending:
No assertion failure this time..
Fast DDS version/commit
Tag v2.9.0 (4c55488)
Platform/Architecture
Ubuntu Focal 20.04 amd64
Transport layer
Default configuration, UDPv4 & SHM
Additional context
Alternatively, you can directly use this PoC to quickly test the behavior. But make sure to compile this with an afl compiler (e.g.,
afl-clang-fast++
) or manually enable theFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
flag to keepparticipantGuidPrefix
uninitialized.Thank you.
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: