Skip to content

fix: remove credential-leaking log statements in sls-logger, hmac-auth, tcp-logger, udp-logger#13205

Merged
Baoyuantop merged 1 commit into
apache:masterfrom
AlinsRan:fix/remove-credential-leaking-logs
Apr 14, 2026
Merged

fix: remove credential-leaking log statements in sls-logger, hmac-auth, tcp-logger, udp-logger#13205
Baoyuantop merged 1 commit into
apache:masterfrom
AlinsRan:fix/remove-credential-leaking-logs

Conversation

@AlinsRan

Copy link
Copy Markdown
Contributor

Summary

Remove debug core.log.info statements that exposed sensitive credentials in nginx error logs at info level.

Vulnerabilities Fixed

  • sls-logger.lua: The rf5424_data string (containing access-key-secret) was logged in combine_syslog() and _M.log() on each log flush.
  • hmac-auth.lua: Canonical header names and values (which may include Authorization and Cookie headers) were logged during HMAC signature generation.
  • tcp-logger.lua / udp-logger.lua: The full serialized log_message payload (containing all request headers and body) was logged before each send.

Changes

Plugin fixes (apisix/plugins/):

  • Remove 8 core.log.info lines across 4 plugin files (sls-logger.lua, hmac-auth.lua, tcp-logger.lua, udp-logger.lua).

Regression tests (t/plugin/):

  • sls-logger.t: Add extra_init_by_lua hook on batch_processor_manager.add_entry_to_new_processor to print entry.data (the raw RFC5424-encoded string) to the error log. Existing TEST 14 and TEST 15 --- error_log assertions continue to verify that request/response body is captured and forwarded correctly.
  • tcp-logger.t / udp-logger.t: Same hook pattern using core.json.encode(entry). Existing TEST 16/17 and TEST 13/14 --- error_log assertions continue to verify body collection works end-to-end.

…h, tcp-logger, udp-logger

Remove debug info-level log statements that exposed sensitive data:
- sls-logger: rf5424_data containing access-key-secret logged on each log flush
- hmac-auth: canonical header names and values (may include Authorization/Cookie) logged during HMAC signature generation
- tcp-logger: full serialized log_message payload logged before send
- udp-logger: full serialized log_message payload logged before send

Add regression tests by hooking batch-processor-manager to verify body
capture still works correctly after removing the debug statements.
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Apr 13, 2026
@Baoyuantop
Baoyuantop merged commit 55234b4 into apache:master Apr 14, 2026
20 of 21 checks passed
wistefan pushed a commit to wistefan/apisix that referenced this pull request Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants