Skip to content

Security: API Request Parameters Logged Without Credential Masking in ApiServer #11987

@YLChen-007

Description

@YLChen-007

Description:

Summary

The ApiServer.handleRequest() method logs all API request parameters at TRACE level without sanitizing sensitive credentials, leading to exposure of passwords, secret keys, and authentication tokens in log files.


Vulnerability Details

Location

Issue Description

When a command is missing or during request processing, the method emits every request parameter and its value at TRACE log level without any sanitization. This includes sensitive fields such as:

  • password (e.g., from DefaultResetPasswordAPIAuthenticatorCmd and other authentication commands)
  • secretkey (API secret keys)
  • apikey (API keys)
  • Authentication tokens
  • Any other caller-supplied credentials

Impact: All sensitive credentials passed through API requests are logged in plaintext, making them accessible through:

  • Log files on disk
  • Centralized logging systems
  • Log aggregation platforms
  • System monitoring tools

Recommended Fix

Mask Sensitive Fields Before Logging

Use existing utility methods to sanitize parameters before logging:

// Use StringUtils.cleanString() combined with explicit field scrubbing
Map<String, Object> sanitizedParams = new HashMap<>(params);
List<String> sensitiveFields = Arrays.asList("password", "secretkey", "apikey", "token", "sessionkey");

for (String field : sensitiveFields) {
    if (sanitizedParams.containsKey(field)) {
        sanitizedParams.put(field, "******");
    }
}

// Log sanitized parameters
LOGGER.trace("Request parameters: {}", sanitizedParams);

References

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions