Repository navigation
fix(security): Don't interpolate values in orgs' sentry_config.ini - #176
Merged
Merged
Conversation
armenzg
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Category: application security (denial of service in request handling).
Vulnerability
_fetch_configparses each org's.sentry/sentry_config.iniwith a plainConfigParser(), which turns onBasicInterpolation. Interpolation expands%(key)sreferences recursively with no memoization or size limit. CPython only caps nesting depth at 10, so the work grows as references per line ^ 10. In a file of a few hundred bytes, each level can reference the one below it ten times (v1 = %(v0)s%(v0)s…, and so on up todsn = %(v9)s). That makescp.get(section, "dsn")build a value of about 10^9 characters.Anyone can trigger this. The GitHub App is public, so an attacker installs it on their own account, commits a file like this to their own
.sentryrepo, and runs any workflow. The app parses the file again on everyworkflow_jobwebhook because a failed parse isn't cached.Severity: medium
The image runs one gunicorn worker with 4 threads and
--timeout 0, so nothing kills a stuck request. Each malicious webhook takes a thread, holds CPU (and the GIL) for hours, and keeps using more memory until the instance runs out. A handful of webhooks stops the app for every org that installed it, and GitHub doesn't redeliver the webhooks that fail. The attacker can't read or change other orgs' data.Evidence
On Python 3.15.2 (the image's version), a 402-byte file with 6 references per line took 110 s and about 100 MB to expand to 10M characters. Each extra reference per line makes it about 5× slower. With interpolation off, the same file parses in under a millisecond. CPython
mainhas the sameBasicInterpolation._interpolate_some, so a newer Python won't fix it. This doesn't depend on production config or scrubbing. Thesentry/sentry-github-actions-appproject shows this path running for many unrelated third-party installations (for example event911786e43ad54672b5fb6887dd96f1c0).Fix
Parse the file with
ConfigParser(interpolation=None).dsnandcommit_workflowsnever need interpolation, and DSNs and workflow file names don't contain%. The only behavior change is that a literal%is now read as-is, where it used to raise an error. No open PR or issue covered this.via automation
sched_2663accc24a4cb8adfb43de4543ec71e· Run IDsched_2663accc24a4cb8adfb43de4543ec71e:1794918600000.--
View Session [Sentry]