Repository navigation
bugfix: Timer-retained coroutines dereference contexts from destroyed requests - #2554
Merged
zhuizhuhaomeng merged 2 commits intoNov 28, 2026
Merged
Conversation
zhuizhuhaomeng
marked this pull request as ready for review
November 28, 2026 06:33
zhuizhuhaomeng
deleted the
codex-security/arp_b27eaed87fe1044d3d13f48693586f8c
branch
November 28, 2026 07:13
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.
The patch now validates coroutine contexts against the active request before returning request-pool metadata.
Static Verification Checks
Current Request Membership (Passed) — src/ngx_http_lua_util.c ngx_http_lua_get_co_ctx matches exdata2 against active request storage, blocking foreign-context metadata access.
Reused Address Defense (Passed) — src/ngx_http_lua_util.c additionally matches Lua state identity, rejecting stale pointers whose pool addresses were recycled.
Safe Coroutine Outcomes (Passed) — src/ngx_http_lua_coroutine.c handles null lookups before dereference, preserving dead status and no co ctx found errors.
Thread Caller Guarding (Passed) — src/ngx_http_lua_uthread.c wait and kill paths reject null lookups before accessing thread ownership or status fields.
Legacy Lookup Compatibility (Passed) — src/ngx_http_lua_util.c preserves the non-exdata2 request-local scan unchanged, maintaining existing coroutine lookup behavior.
Regression Boundary Coverage (Passed) — t/197-coroutine-request-cleanup.t expects overlapping and expired foreign coroutines rejected while newly local coroutines resume successfully.
Static Verification Scope (Passed) — Final git diff inspection used no runtime checks and established source-only closure of the reported attack path.
Finding:
acf_8c793d665baac688a369fdd85d8ccc33Patch:
arp_b27eaed87fe1044d3d13f48693586f8cBase commit:
a7733460bc1052e7eedb5240dfbc1cdb98527950Patch SHA-256:
abaaef060dd45e66819367439f621e25545b5e3a8cac979a429129f1f62a868b