Repository navigation
fix(codeql): resolve the three open code-scanning alerts - #6
Merged
Merged
Conversation
- cpp/declaration-hides-parameter: the lambda pack in SharedMemoryRepository::construct() has no homonymous parameter; renaming only changed the reported name. Unpack the tuple via constructFromTuple() and std::index_sequence_for instead of std::apply with a variadic lambda. - cpp/path-injection: export_repository writes to the operator's own --file argument in their own process, so no privilege boundary exists. Keep the sink with a justified // codeql[cpp/path-injection] suppression and report a failed open instead of ignoring it. - cpp/poorly-documented-function: document parseDatabaseEntry() and its validation sections. Docs table and the false-positive rationale are updated as well.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the three open CodeQL
security-and-qualityalerts:cpp/declaration-hides-parameter(SharedMemoryRepository.h:277) — the lambda parameter pack has no homonymous parameter; renaming it only changed the name in the report (constructorArgs->ctorArgs, still open). Thestd::applylambda is replaced byconstructFromTuple()plusstd::index_sequence_for, so no nested parameter pack is introduced.cpp/path-injection(SharedMemoryCliComponent.cpp:147) —export_repository --filewrites to a path the operator passed to their own process, so there is no privilege boundary and no sanitizer the rule could accept. The sink stays with a justified// codeql[cpp/path-injection]suppression, matchingexamples/named_pipe_server.cpp. A failed open now throws instead of silently writing nothing.cpp/poorly-documented-function(DatabaseConnectionComponent.cpp:22) —parseDatabaseEntry()and its validation sections are documented.docs/code-scanning.mdrecords the alert count and the false-positive rationale for thedeclaration-hides-parametercase.Verification
build/build/Release, GCC 14).ctest --output-on-failure --label-regex unit: 1311/1311 passed (PostgreSQL tests skipped, no server running)../scripts/check-format.sh master: no formatting regression../scripts/check-namespace.sh: pass (268 headers).Note
The same change was briefly on
masterbefore this PR (0f23b23, reverted ine7ca290). This branch reapplies it as58be75b, so merging restores the fixes.