Repository navigation
Conversation
The `WWSafe.pm` module is based on version 2.47 of the upstream `Safe.pm` module, which includes a `_clean_stash` method that deletes the `DESTROY`, `AUTOLOAD`, and overload methods defined by compartment code after the compartment code is executed. This is intended to prevent that code from running outside of the safe compartment (for instance when an object is destroyed, since destruction happens outside the compartment), where it would run with the `main::` symbol table rather than the compartment's isolated one. However, this breaks macros that define such methods. For example, the `AUTOLOAD` method of `context::Extensions::Super` in `contextExtensions.pl` (used by `contextFraction.pl`, `contextUnits.pl`, and `contextSignificantFigures.pl`) is deleted, which breaks any context that extends another context, such as using the Units context together with the SignificantFigures context. The other improvements from the 2.47 update (the `reval`/`rdo` reentrancy handling and the wrapping of code references returned from the compartment) are retained. This is an alternative, perhaps slightly less secure but yet secure enough, approach to fixing the issue created with the `contextExtensions.pl` macro by the updated `WWSafe.pm` module to openwebwork#1564. Note that this completely negates openwebwork#1565 as well. See my comments in openwebwork#1564 (comment) about why this is "secure enough". Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Member
Author
This branch has not been deployed
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.
The
WWSafe.pmmodule is based on version 2.47 of the upstreamSafe.pmmodule, which includes a_clean_stashmethod that deletes theDESTROY,AUTOLOAD, and overload methods defined by compartment code after the compartment code is executed. This is intended to prevent that code from running outside of the safe compartment (for instance when an object is destroyed, since destruction happens outside the compartment), where it would run with themain::symbol table rather than the compartment's isolated one.However, this breaks macros that define such methods. For example, the
AUTOLOADmethod ofcontext::Extensions::SuperincontextExtensions.pl(used bycontextFraction.pl,contextUnits.pl, andcontextSignificantFigures.pl) is deleted, which breaks any context that extends another context, such as using the Units context together with the SignificantFigures context.The other improvements from the 2.47 update (the
reval/rdoreentrancy handling and the wrapping of code references returned from the compartment) are retained.This is an alternative, perhaps slightly less secure but yet secure enough, approach to fixing the issue created with the
contextExtensions.plmacro by the updatedWWSafe.pmmodule to #1564. Note that this completely negates #1565 as well. See my comments in #1564 (comment) about why this is "secure enough".