-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
C++: Adding a model implementation for ODBC. #14647
C++: Adding a model implementation for ODBC. #14647
Conversation
(cherry picked from commit 04147f8)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of comments.
Additionally, would it be possible to add some tests to the end of the https://github.com/github/codeql/blob/main/cpp/ql/test/query-tests/Security/CWE/CWE-089/SqlTainted/test.c file? Or if you prefer to the C++ file: https://github.com/github/codeql/blob/main/cpp/ql/test/query-tests/Security/CWE/CWE-089/SqlTainted/test.cpp
Basically, we just want a test that confirms that we can track tainted flow coming into the sink.
@@ -9,6 +9,7 @@ private import implementations.Iterator | |||
private import implementations.MemberFunction | |||
private import implementations.Memcpy | |||
private import implementations.Memset | |||
private import implementations.ODBC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should move it down to the other SQL-like imports?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
DCA looks good: performance is unaffected, and we're finding 4 new results that seem genuine. So I think this PR is good to go once the above comments have been addressed 🎉 |
Thanks. I'll look over the change suggestions shortly. |
@MathiasVP, I've made the suggested changes and added a quick ODBC sql injection test. Let me know if there is anything else need to close this out. Thanks |
Looks good. Thanks! The only thing we need now is to make the autoformatter happy. CI tells me that the You can do this using |
Whoops. I did this on my initial push but forgot to do it for the recent changes. It should be all good now. |
* The other source of input to a `SQLExecute` is via a `SQLBindParameter`, which sanitizes user input, | ||
* and would be considered a barrier to SQL injection. | ||
*/ | ||
private class ODBCExecutionFunction extends SqlExecutionFunction { |
Check warning
Code scanning / CodeQL
Acronyms should be PascalCase/camelCase. Warning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Adds a model implementation for ODBC database APIs.