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.
|
@pronskiy I've never used these two tools so I am not really sure what we are expecting to see here. I tried to see the results of the CodeQL scan but they seemed empty. And the ASAN + UBSAN test run was full of errors. Do you have more info on what we are expected to see or how to interpret the results? One thing: for the CodeQL scan we should use V4 of the GitHub action, V3 is deprecated as far as I can tell from the run output And in the ASAN + UBSAN check you need to update the version of the actions/cache GitHub action as V4 is also deprecated |
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.