Skip to content

[Bug] Proxy and broker configuration logs may expose sensitive values #10950

Description

@qianye1001

Before Creating the Bug Report

  • I found a bug, not just a question.
  • I searched existing GitHub issues and discussions and did not find a duplicate.
  • I confirmed that the bug belongs to this repository.

Runtime platform environment

Any environment that starts Broker or Proxy, or updates Broker configuration at runtime, with sensitive configuration values.

RocketMQ version

  • Branch: develop
  • Commit: 293f588571

JDK Version

Reproduced and verified with Amazon Corretto JDK 11.0.23.

Describe the Bug

Broker and Proxy print complete configuration snapshots to normal logs during startup. Broker runtime configuration updates also print the incoming properties and old/new replacement values. These log projections currently have no explicit sensitivity marker or masking policy, so values such as TLS key passwords, authentication bootstrap data, inner-client credentials, SOCKS proxy credentials, and metrics exporter headers may be exposed in log files.

This iteration covers the normal full-configuration startup logs of Broker and Proxy and the Broker dynamic configuration update log. Existing exception/error logs, Controller, BrokerContainer, and Namesrv are out of scope. The open-source Proxy currently has no runtime dynamic configuration reload path.

Steps to Reproduce

  1. Configure Proxy with a non-empty tlsKeyPassword or metricsGrpcExporterHeader, or configure Broker with a non-empty metricsGrpcExporterHeader.
  2. Start the corresponding component and inspect its configuration startup log.
  3. Alternatively, update an annotated Broker configuration property at runtime.
  4. Observe that the configured value is written without masking.

What Did You Expect to See?

Sensitive configuration fields should be explicitly marked and masked only in log projections. Broker dynamic logs should contain only properties whose values actually changed. The masked text should retain a short prefix and suffix for troubleshooting, while the original configuration object, parsing, serialization, update, persistence, and runtime behavior remain unchanged.

What Did You See Instead?

The full sensitive value is present in the log.

Additional Context

The proposed fix introduces a runtime field annotation and a shared log-only masking utility. Only explicitly annotated fields are masked; there is no key-name fallback. Unannotated fields remain unchanged even when their names contain words such as password, secret, AK, or SK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions