Repository navigation
bugfix: TLS key-log files are created with default world-readable permissions - #2559
Merged
zhuizhuhaomeng merged 1 commit intoNov 28, 2026
Merged
Conversation
zhuizhuhaomeng
marked this pull request as ready for review
November 28, 2026 07:16
zhuizhuhaomeng
deleted the
codex-security/arp_2e9bf1a41fd0f58f11d8381fb16b7384
branch
November 28, 2026 07:25
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 makes TLS key-log creation and reuse owner-only before any secret is written.
NGX_FILE_OWNER_ACCESS, removing the 0644 creation path that exposed TLS secrets.Static Verification Checks
Owner-only file creation (Passed) — ngx_http_lua_ssl_key_log uses NGX_FILE_OWNER_ACCESS, establishing newly created Unix key logs exclude non-owner access.
Existing file validation (Passed) — ngx_http_lua_ssl_key_log validates descriptor ownership and mode bits, establishing unsafe existing files fail closed.
Callback registration ordering (Passed) — src/ngx_http_lua_module.c registers key_log_callback after validation, establishing rejected descriptors cannot receive TLS session secrets.
Legitimate append behavior (Passed) — t/129-ssl-socket.t retains append-and-read assertions, establishing valid SSLKEYLOGFILE output and prior content preservation.
Permission regression coverage (Passed) — t/200-ssl-key-log-permissions.t asserts mode 0600 and broad-file rejection, establishing both permission boundaries are regression-covered.
Finding:
acf_fa06d998740387a02b13dbd78cf53980Patch:
arp_2e9bf1a41fd0f58f11d8381fb16b7384Base commit:
5079ce71b15b21729ce3c5a75e98ddd1007fb619Patch SHA-256:
10d89c8f122661af49e8d4567b180a1246cc5732a018547b387b62d22d52777b