Skip to content

Redact credential query parameters in stored urls - #25

Open
JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/redact-secrets-in-stored-urls
Open

JonPurvis wants to merge 1 commit into
saloonphp:mainfrom
JonPurvis:fix/redact-secrets-in-stored-urls

Conversation

@JonPurvis

Copy link
Copy Markdown

Barstool redacts Authorization and Set-Cookie already, but the stored URL kept the raw query string. Requests that interact with APIs that require auth via a query param such as ?access_token=secret&api_key=secret was written in full on the request, the response, and a connection error. Yes, services shouldn't have such poor security 😆

Credential query values are now replaced with REDACTED before the URL is stored. Matching ignores case, so API_KEY is covered as well as api_key. Ordinary parameters such as account_id are kept. User info in the URL (user:password@host) is stored as REDACTED:REDACTED. The outgoing request is left unchanged.

The default names are access_token, api_key, api-key, apikey, client_secret, id_token, password, refresh_token, secret, sig, signature, and token. excluded_query_parameters replaces that list, and * redacts every query value. Installs that have not published the new config key still use the default list.

@Sammyjo20 Sammyjo20 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great catch! :dependabot:

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

Successfully merging this pull request may close these issues.

2 participants