Repository navigation
fix: address the first CodeQL findings - #5
Merged
Merged
Conversation
- net_posix.cpp (cpp/command-line-injection, critical): the wired-NCM bring-up concatenated the interface name and the caller-supplied link-local address into a shell command and ran it with popen(). Run ip/nmcli through posix_spawnp() with an explicit argv instead, and reject interface names and addresses whose characters have no business in either. The shell is gone, so quoting bugs cannot become command execution. - server.cpp (cpp/comparison-with-wider-type): the RTSP port fallback compared a uint16_t loop variable against an int expression, which would wrap at 65535. Iterate in uint32_t and stop at the end of the port space. - pair_record.cpp (cpp/redundant-null-check-simple): `found` was dereferenced before the null check that followed it. Guard the dereference and keep the out-parameter optional. Verified in the Ubuntu 24.04 CI image: full build, and iap2_test / m3_test / aa_wire_test all pass. Co-Authored-By: Claude Code <noreply@anthropic.com>
UnmetDecade
force-pushed
the
fix/codeql-alerts
branch
from
November 15, 2026 01:42
43911fd to
b9c2977
Compare
UnmetDecade
added a commit
that referenced
this pull request
Nov 15, 2026
The landing pages linked architecture.md, PROTOCOL-NOTES.md and projection-backend.md directly. With .nojekyll set, Pages serves those as text/markdown, so clicking a card showed the raw source instead of the rendered document. Point them at the GitHub blob URLs, matching the README/CONTRIBUTING/SECURITY links right below them, in both languages. Also record the CodeQL fixes merged in #5 under Unreleased. Co-authored-by: UnmetDecade <UnmetDecade@users.noreply.github.com> Co-authored-by: Claude Code <noreply@anthropic.com>
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
Closes the three CodeQL alerts that the first analysis run opened on
main.platform/posix/net_posix.cppcpp/command-line-injection(critical)popen()is gone;ip/nmclirun throughposix_spawnp()with an argvcore/projection/carplay/airplay/server.cppcpp/comparison-with-wider-typeuint32_tand stops at 65535core/projection/carplay/usb/pair_record.cppcpp/redundant-null-check-simplefoundoptionalDetails
Command injection. The wired CarPlay bring-up built shell strings from the interface name and from the caller-supplied link-local address (
--wired-ll). Single quotes were the only defence. It now passes an explicit argument vector, so no shell parses the values; both are also validated up front (charset and length), becauseipitself would read a leading-as an option. Behaviour is unchanged otherwise: same commands, same output capture, same exit-code checks.Port fallback.
for (uint16_t p = cfg_.port; p < cfg_.port + 20; ++p)compared a narrow type with a promotedint; near 65535 the counter wraps and the loop never terminates. The loop is nowuint32_tand clamps at the end of the port space.Redundant null check.
loadWiredPairCerts()was followed byif (!*found)and thenif (found != nullptr) *found = false— the second check was dead. The first is now guarded.Verification
iap2_test(with a generated test identity),m3_test,aa_wire_test: all pass.🤖 Generated with Claude Code