Skip to content

fix: use defineProperty instead of assignment #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FUDCo
Copy link

@FUDCo FUDCo commented May 14, 2025

The returnlessSource function stumbles over the infamous Javascript assignment override mistake (which is to say, it throws a TypeError that it very much should not be throwing) if running in a locked down environment where the primordials are frozen. The fix is to use defineProperty instead of direct assignment in the sensitive property updates.

@FUDCo FUDCo requested review from achingbrain and a team as code owners May 14, 2025 01:04
@achingbrain achingbrain changed the title Fix collision with JS override mistake fix: use defineProperty instead of assignment May 14, 2025
@achingbrain
Copy link
Collaborator

Thanks for opening this. What environment are you running in where the current implementation causes a problem?

@FUDCo
Copy link
Author

FUDCo commented May 14, 2025

Thanks for opening this. What environment are you running in where the current implementation causes a problem?

The specific environment where we ran into this was Hardened JavaScript, but any similar high-integrity JS environment that freezes primordials will be prey to this issue.

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