Skip to content
Payments · Secret guide

Leaked Polar Organization Access Token: what to do in the first hour

High severityDetected onlyLast verified · 5 min read

A Polar organization access token, often called an OAT, is the credential that lets a tool act on behalf of a Polar organization. Polar is a platform for selling software subscriptions and digital products, and the token can read and change the parts of the organization it was scoped to: products, customers, subscriptions, orders and webhooks, depending on the permissions chosen. A leaked token that can manage customers or payments is a payment-data problem as much as a code problem. Revoke it first, then check what it changed.

Check your GitHub account for leaked secrets — free

Provider
Polar
Severity
High
Impact
Payments and customer data
Checked live by LeakWatch
No

What a Polar Organization Access Token looks like

Polar organization access tokens start with polar_oat_, followed by a string of letters, digits, underscores and dashes:

polar_oat_…XXXX   Polar organization access token (masked)

The polar_oat_ prefix is specific to this kind of token. Polar’s documentation describes it as an organization-level token, which is created in the organization’s developer settings with a name, an expiry and a set of scopes. The scopes decide what the token can do, so a token used only to read products is far less dangerous than one that can change subscriptions or refund orders.

A token is usually stored as an environment variable, such as a Polar access token setting in a deployment or a CI job. It is often placed in the same file as the other secrets of a billing integration, which is why a single leak can expose several payment-related credentials at once.

How Polar Organization Access Tokens get leaked

  • CI configuration. A pipeline file that writes the token directly into a command or a file, committed to the repository instead of referencing a secret variable.
  • Deployment templates. An infrastructure file that contains the token in a value field, copied into a public example repository.
  • Frontend code. A token placed in a browser script or a mobile app that calls Polar directly. Anyone who loads the page can read it.
  • Shared scripts. A reporting or migration script with the token typed in, sent to a colleague or posted to a support thread.
  • Build logs. A job that prints its environment, or an error message that shows the request headers sent to the API.

What to do in the first hour

  1. Revoke the token. Open the organization settings in Polar, go to the Developers section, and remove the token that leaked. If you cannot find it, revoke all tokens created for the integration and create new ones afterwards.
  2. Review subscriptions and orders. Check the customers, subscriptions, orders and refunds for the period since the token may have been exposed. Look for refunds you did not approve, plan changes you did not make, and new products or prices that you do not recognize.
  3. Check webhooks. Review the webhook endpoints for the organization. An attacker who can change an endpoint can receive your customer and payment events, so remove any endpoint you did not create.
  4. Create a replacement with the smallest scopes the integration needs, and set an expiry date where the interface allows one. Store it in your secret manager or in the deployment’s secret settings.
  5. Rotate the other payment secrets that sat with the token, including webhook signing secrets and any processor keys in the same file.
  6. Clean the code. Remove the value from the files and check the history for older copies. See I accidentally pushed an API key to GitHub.

Not sure what else leaked from the same project? Run a free scan.

Not sure what else leaked? Run a free scan.

Revoke it at Polar

Polar’s documentation for organization access tokens describes creating one from your organization’s settings, in the Developers section, with the New Token action. Open the organization settings, go to that section, and look for the list of existing tokens so that you can remove the leaked one. The OAT guide is published at docs.polar.sh. The documentation that was consulted for this guide did not describe the step for removing an organization access token from the interface, so this section could not be confirmed against the live page. Check the current list in the settings, and if you cannot remove the token there, contact Polar support with the token’s name and the time of the exposure.

How LeakWatch detects it

The rule is called “Polar Organization Access Token”. It looks for the prefix polar_oat_, followed by between twenty and one hundred letters, digits, underscores or dashes, and the match must end at a quote, a space, a semicolon, a line break or the end of the line. A value cut short, or with a different prefix, is not reported. The severity is high, with the impact class for payment data. This type is not checked live: LeakWatch does not call Polar with the token it finds.

LeakWatch detects this format but does not check it live: it can tell you the key is exposed, not whether it still works. Assume it does until you have revoked it.

FAQ

Does a Polar token give access to customers' card details?

This guide cannot confirm what card-related data, if any, a token can reach. What a token can reach is set by its scopes, and this guide does not claim more than that. Treat it as a payment-related credential regardless.

Should I rely on the token's expiry date?

An expiry date limits the damage of a leak that goes unnoticed, but it does not replace revocation. Revoke the token as soon as you know it leaked, and do not wait for the expiry.

What if the token was only in a private repository?

A private repository is safer than a public one, but everyone with access, every clone and every shared backup can read the value. Treat the token as exposed if the repository was ever public, forked or shared with people who should not have it.

Get alerted next time a secret leaks — create a free account

LeakWatch is not affiliated with Polar.