Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Credentials are printed to stdout for every request #3

Open
jenssuhr opened this issue Jul 23, 2024 · 0 comments
Open

Credentials are printed to stdout for every request #3

jenssuhr opened this issue Jul 23, 2024 · 0 comments

Comments

@jenssuhr
Copy link

jenssuhr commented Jul 23, 2024

Hello,
the following code in Communication (https://github.com/Vantiv/cnp-chargeback-sdk-java/blob/2.x/src/main/java/com/cnp/sdk/Communication.java#L212) prints all headers, including the Authorization header to stdout for every request without an option to deactivate this behavior:

try {
    HttpResponse response = httpClient.execute(baseRequest);
    return validateResponse(response);
} catch (IOException e) {
    throw new ChargebackException(CONNECTION_EXCEPTION_MESSAGE, e);
} finally {
    System.out.println("Headers");
    for(Header header : baseRequest.getAllHeaders()) {
        System.out.println(header.getName() +" : "+header.getValue());
    }
    baseRequest.abort();
}

In my opinion, this is both unnecessary and a potential security risk. Other debug logging uses printToConsole which is opt-in via configuration properties and masks sensitive information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant