GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — fix(core): Read __sentry_original__ as own property to avoid overflow on cyclic Proxy prototype chains by chiliec · Pull Request #25964 · getsentry/sentry-javascript Conversation
Contributor
Fixes #25963 What
This remained after #25921 / #25922, which fixed the Fix
return Object.prototype.hasOwnProperty.call(func, '__sentry_original__') ? func.__sentry_original__ : undefined; TestsAdded a regression test to the existing Validation (local):
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…Function The FunctionToString integration's patched toString reads this.__sentry_original__ via getOriginalFunction, which walks the prototype chain for a function that lacks the own property. When the chain loops back through a Proxy the walk never terminates and overflows the stack inside the wrapper, while native toString returns normally. markFunctionWrapped always sets __sentry_original__ as an own non-enumerable property, so reading it as an own property is equivalent for every wrapped function and avoids the unbounded prototype walk. Signed-off-by: Vladimir Babin <[email protected]>
chiliec
force-pushed
the
fix/functiontostring-cyclic-proxy-prototype
branch
from
bee0f9d to
78f76f3
Compare
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cursor Bugbot has reviewed your changes and found 1 potential issue. ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard. Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard. Reviewed by Cursor Bugbot for commit 78f76f3. Configure here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Regression test skips patched toStringLow Severity The new test binds Triggered by project rule: PR Review Guidelines for Cursor Bot Reviewed by Cursor Bugbot for commit 78f76f3. Configure here.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
logaretm
requested changes
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for digging into this! Per our contributing guide, we would have appreciated a discussion first before taking it on, since we shipped two PRs in this area. I'm closing this because Here is an example: // e.g. an anti-tamper or call-tracing script Function.prototype.call = function (thisArg, ...args) { const isNative = this.toString().includes('[native code]'); return Reflect.apply(this, thisArg, args); }; setTimeout.toString(); // RangeError: Maximum call stack size exceeded
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
external
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. FunctionToString overflows on cyclic Proxy prototype chainsUh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |