Perhaps it can be considered that the poc I provided is unexpected input, which exposes a flaw in cppcheck. Maybe in the next version, cppcheck should reject this type of input.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This has been inexplicably reported as a security issue and has a CVE number assigned. Maybe cppcheck should consider adding a security policy document that describes what could conceivably be considered a security issue so that such useless CVEs don't waste everyone's time. I had contributed a security policy here for yasm, which could be adapted for cppcheck:
what could conceivably be considered a security issue
I don't consider bugs to be security issues. Cppcheck is a developer tool purely for "internal" usage. I expect that it runs in a safe and trusted environment.
👍
1
Last edit: Daniel Marjamäki 2023-09-13
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sadly.. if you are concerned about cppcheck crashes when the input is garbage, then you should run your compiler first on all the input to ensure that it's not garbage.
Implementing a full syntax checker in Cppcheck would take a lot of time. Especially since we want to allow compiler extensions. We just don't have the resources to do that.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Implementing a full syntax checker in Cppcheck would take a lot of time.
the problem is that all compilers have different syntax checks due to various language extensions.
writing a syntax checker that matches all the compilers.. I envision that we could spend 100% of our time for years.. and in practice that would have no value at all for users, they could just run their compiler instead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Description
Heap UAF in lib/token.cpp:1934
Version
Replay
POC
poc
ASAN
Environment
Last edit: Tamagawa Takeshi 2023-07-19
That is clearly invalid code. Cppcheck generally assumes that its input is compileable.
Perhaps it can be considered that the poc I provided is unexpected input, which exposes a flaw in cppcheck. Maybe in the next version, cppcheck should reject this type of input.
This has been inexplicably reported as a security issue and has a CVE number assigned. Maybe cppcheck should consider adding a security policy document that describes what could conceivably be considered a security issue so that such useless CVEs don't waste everyone's time. I had contributed a security policy here for yasm, which could be adapted for cppcheck:
https://github.com/yasm/yasm/blob/master/SECURITY.md
I don't consider bugs to be security issues. Cppcheck is a developer tool purely for "internal" usage. I expect that it runs in a safe and trusted environment.
Last edit: Daniel Marjamäki 2023-09-13
ok adding a SECURITY.md document similar to that is probably a good idea. If that avoids that people waste time on such reports.
Sadly.. if you are concerned about cppcheck crashes when the input is garbage, then you should run your compiler first on all the input to ensure that it's not garbage.
Implementing a full syntax checker in Cppcheck would take a lot of time. Especially since we want to allow compiler extensions. We just don't have the resources to do that.
the problem is that all compilers have different syntax checks due to various language extensions.
writing a syntax checker that matches all the compilers.. I envision that we could spend 100% of our time for years.. and in practice that would have no value at all for users, they could just run their compiler instead.
Also, having strict syntax checking is in conflict with the aim of handling incomplete code.