Public and secret api key leaked via omise github repo(owned by omise)
A public and secret API key pair for a payment provider were committed into a public GitHub repository's README. An attacker could use the secret key to create customers, cards and charges and to read account information such as the balance, though the reporter was unsure whether the keys were test-only.
Originally disclosed on HackerOne
- Disclosed after 14 days
Found secret key of particular omise accounts! Functionality of the public and secret keys are described below:
Public key
The public key can be used to create tokens via javascript from your customers browsers. This key can be safely exposed to the outside world.
Secret key
The secret key can be used to create customers, cards and charges and to retrieve information about your account, such as its balance. You must keep this key from prying eyes.
I have got both public and secret key on omise github repo.But not sure if they were created only for testing purpose
##Go to : https://github.com/omise/omise-php/blob/1158aeceb83c55d4b2188b75ae0f899d7af3881a/README.md scroll down.and you will see leaked keys!!
<?php
require_once dirname(__FILE__).'/vendor/autoload.php';
define('OMISE_PUBLIC_KEY', 'pkey_test_54ot96fkr3i2op60cng');
define('OMISE_SECRET_KEY', 'skey_test_54ot96fkr3i2op60cng');
define('OMISE_API_VERSION', '2017-11-02');
thank you
Impact
Attacker can use the secret key to create customers,cards and charges and to retrieve info about the particular account,such as its balance.
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
Likely a developer committed example credentials into a public README instead of using placeholders or environment variables.
Impact
An attacker could use the secret key to create customers, cards and charges and to retrieve account information such as the balance, although the reporter was not sure the keys were only for testing.
What the attacker needed
Public GitHub repository; no account needed to read it
The fix
The keys should be kept private rather than exposed in a public repository.
How it was found
- Open the linked README file in the public repository.
- Scroll down to the code sample.
- Observe the public and secret key values defined in the sample.
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 key is like a password that lets a program talk to a payment service on your behalf. Here, someone put such a key into a file that anyone on the internet can read. If the key is real, a stranger could act as the account owner, for example by creating charges or looking up the balance.
What is Leaked secrets?
Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.