nginx-c-module-debugging

Fail

Audited by Socket on Feb 16, 2026

3 alerts found:

Obfuscated Filex2Anomaly
Obfuscated FileHIGH
references/memdbg-use-after-free.md

The code demonstrates a critical memory-safety bug: storing pointers into request-scoped pool memory in connection-scoped state leads to use-after-free when the request ends and the connection context is later accessed (e.g., on keepalive). The corrected pattern (deep-copy into connection pool) is the appropriate fix. This is a stability/availability risk (crashes, memory corruption) rather than malicious code or data exfiltration.

Confidence: 98%
AnomalyLOW
references/memdbg-slab-corruption.md

This code sample contains a critical concurrency bug in the "Incorrect" example: shared memory structures (rbtree and slab metadata) are modified without acquiring the shared memory mutex, which can lead to cross-worker slab corruption and crashes. The provided "Correct" example demonstrates the appropriate fix (hold shmtx, use ngx_slab_alloc_locked, and use atomics for simple counters). There is no evidence of malicious behavior, network exfiltration, obfuscation, or hidden backdoors in the provided code. The risk is functional/security-related (data structure corruption and crashes) and should be treated as high-severity for correctness and availability but not malware.

Confidence: 90%Severity: 60%
Obfuscated FileHIGH
references/memdbg-buffer-overrun.md

The provided incorrect implementation contains a deterministic 2-byte buffer overrun when building the key (writes separator and null terminator past the allocated buffer). Because ngx_pnalloc returns contiguous pool memory, this leads to silent corruption of the next pool allocation and can cause crashes or data corruption later. The corrected code (compute prefix->len + 1 + uri->len and allocate key->len + 1) resolves the issue. This is a critical stability/security bug to be fixed; it appears to be an inadvertent programming error rather than malicious code.

Confidence: 98%
Audit Metadata
Analyzed At
Feb 16, 2026, 03:21 AM
Package URL
pkg:socket/skills-sh/pproenca%2Fdot-skills%2Fnginx-c-module-debugging%2F@ae1e9a5455a826409d870070c976fbdcc44de6b2