Open
Conversation
- CodeQL: semantic analysis with security-extended queries (every push/PR + weekly) - ASAN + UBSAN: runtime sanitizers, builds PHP from source with sanitizer flags (every push/PR) - Cppcheck: fast static analysis for leaks, null derefs, fd leaks (every push/PR) - Clang Static Analyzer: path-sensitive analysis via scan-build (weekly + manual dispatch)
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
The hash destructor callback was declared as taking struct xdebug_fiber_entry * but registered as xdebug_hash_dtor_t (void (*)(void *)). Calling through the mismatched pointer type is undefined behavior per C11 §6.5.2.2. Fix: accept void * and cast inside the function body. Zero performance impact — identical generated code.
The DBGp test client had hardcoded 3s/5s socket timeouts. Under ASAN (2-3x slower), PHP takes longer to respond, causing false test failures. Fix: make timeouts configurable via DBGP_TIMEOUT env var (defaults unchanged). Set DBGP_TIMEOUT=10 in the sanitizer CI workflow.
Parallel ASAN-instrumented PHP processes compete for CPU on CI runners, causing DBGp socket timeouts. Run with -j1 for reliable results.
The ASAN-instrumented test suite has ~36-45 test output mismatches (known XFAIL tests + ASAN-induced timing differences). These are not memory bugs. The CI now runs all tests, captures output, and fails ONLY when actual sanitizer errors are detected (AddressSanitizer, LeakSanitizer, UBSAN runtime errors). Test output mismatches are logged but do not block the PR.
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.
What
Add two security-focused CI workflows:
security-extendedqueries. Catches common C vulnerability patterns statically (every push/PR + weekly).Trimmed from the original PR #8 — removed Cppcheck and Clang Static Analyzer (overlap with CodeQL, noisy on inherited Xdebug code).
Attack Surface Analysis
This PR is informed by a threat model of the extension. Key vectors:
Network — DBGp (TCP :9003)
evalMemory Safety (C extension)
max_depthINI limits thisInformation Disclosure
Not Applicable (yet)
Files
.github/workflows/sanitizers.yml— ASAN + UBSAN on PHP 8.3, 8.4.github/workflows/codeql.yml— CodeQL with security-extended queriesSupersedes #8.