Skip to content
Info disclosure Disclosed report Beginner

Secret API Key is logged in cleartext

The Omise Python library logs the secret API key in cleartext when debug logging is enabled, so the key may end up in copied logs or recorded demonstrations.

sim4n6 Follow

Originally disclosed on HackerOne

  • Triaged in 3 days
  • Fixed in 4 months
  • Paid in 4 months
  • Disclosed after 5 months

Summary by the researcher

By @Sim4n6

The report

Summary:

While code-reviewing the repository https://github.com/omise/omise-python/, I have found that you log in clear-text some sensitive data.

Steps To Reproduce:

  1. Check here omise/request.py#L88 and here omise/request.py#L111
  2. The code source explicitly logs in debugging mode the secret API key.
logger.debug('Authorization: %s', self.api_key)
  1. Activate logging level debug and run the following sample.py file
import omise
omise.api_secret = 'skey_test_5sqdfyjv0rtqzs9f2x2'

customer = omise.Customer.create(
   description='John Doe',
   email='[email protected]'
)

You will get:

Screenshot_at_2022-08-07_21-39-21.png
Screenshot_at_2022-08-07_21-39-21.png From the original on HackerOne

Impact

  • sensitive data logged in clear text may end up in unusual places: recorded demonstrations, copied logs, etc.

Remediation

  • I suggest you log at least a partial part of the secret API key if not remove the L88 and L111 in whole.

The original report as published on HackerOne, by sim4n6. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The library's request code includes a debug log statement that prints the full Authorization header, which contains the secret API key.

Impact

Sensitive data logged in clear text may end up in unusual places such as recorded demonstrations or copied logs, potentially exposing the secret API key.

What the attacker needed

Debug logging enabled; access to log output

The fix

The library should remove the debug log statements that print the full secret API key, or at most log a partial portion of it.

How it was found

  1. Review the request.py file at the linked lines.
  2. Observe that the code logs the secret API key in debug mode.
  3. Enable debug logging and run a sample script that creates a customer.
  4. See the secret API key appear in the log output.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A secret API key is like a password that lets a program talk to a service. This library was writing that key into its debug log, a file that records what the program is doing. If that log is copied or recorded, the key may be exposed.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by sim4n6

View all

5 more disclosed reports, best first.

More from Omise

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.