Repository navigation
Conversation
Akamai's prototype probe can create a cycle on the proxied Function.prototype.toString, causing fn.toString() calls across the page to overflow the stack. run() now wraps Proxy with a setPrototypeOf trap that checks the chain before changing it. The check rejects chains reaching the proxy or its target and stops at other proxies from the same wrapper. Returning false makes Reflect.setPrototypeOf() return false and Object.setPrototypeOf() throw a TypeError.
qiu-x
force-pushed
the
proxy-cycle-fix
branch
from
November 9, 2026 16:11
47e797a to
dd308f6
Compare
chrmod
approved these changes
Nov 10, 2026
philipp-classen
force-pushed
the
proxy-cycle-fix
branch
from
November 11, 2026 22:33
e7b0c9e to
026a6e8
Compare
Copy scriptlet-owned traps into a null-prototype handler so page changes to Object.prototype cannot inject traps or interfere with cycle checks.
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.
This fix resolves an issue with scriptlet injection that appeared on multiple websites using an older version of Akamai Bot Manager (probably 2.x).
Websites with the issue include:
Click me
I verified that uBO also has this issue on the listed sites (but doesn't include any rules to trigger the problem unlike us).
It might be worth it to also try fixing this upstream.
Context:
Akamai’s prototype probe can create a cycle on the proxied
Function.prototype.toString, causingfn.toString()calls across the page to overflow the stack.run()now wraps Proxy with asetPrototypeOftrap that checks the proposed chain before changing it. The check rejects chains reaching the proxy or its target, including through other scriptlet proxies. Tortoise-and-hare traversal terminates walks over already-cyclic chains.Handlers have a null prototype and contain only scriptlet-owned traps, preventing page changes to
Object.prototypefrom injecting traps. Traversal can still invoke traps on page-owned proxies, unlike native cycle checks; this remains an accepted detection and nontermination risk.Note: kroger.com and fredmeyer.com are already fixed by a site specific rule that was added here.