Skip to content

fix(codeql): resolve the three open code-scanning alerts - #6

Merged
dkruempe merged 1 commit into
masterfrom
fix/codeql-alerts
Oct 22, 2026
Merged

dkruempe merged 1 commit into
masterfrom
fix/codeql-alerts

Conversation

@dkruempe

Copy link
Copy Markdown
Owner

Summary

Fixes the three open CodeQL security-and-quality alerts:

  • 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). The std::apply lambda is replaced by constructFromTuple() plus std::index_sequence_for, so no nested parameter pack is introduced.
  • cpp/path-injection (SharedMemoryCliComponent.cpp:147) — export_repository --file writes 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, matching examples/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.md records the alert count and the false-positive rationale for the declaration-hides-parameter case.

Verification

  • Release build green (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 master before this PR (0f23b23, reverted in e7ca290). This branch reapplies it as 58be75b, so merging restores the fixes.

- 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-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@dkruempe
dkruempe merged commit 22ee609 into master Oct 22, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants