Skip to content

Fix the _clean_stash handling for the WeBWorK::WWSafe package. - #3256

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:safe-better-clean-stash
Open

drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:safe-better-clean-stash

Conversation

@drgrice1

Copy link
Copy Markdown
Member

This uses the same shared-package defense from the pg pull request openwebwork/pg#1565.

The snapshot_hooks method can be called to record the hooks in the shared packages once the compartment is fully set up but before the user provided code runs, and _clean_stash then uses that to restore any shared hook the user supplied code overwrites in place and strip all hooks the user provided code adds (so a hook in a new Mojo::Exception::Evil package is stripped, but Mojo::Exception's overloads are left alone). snapshot_hooks is called from the AchievementNotification task, which is the only consumer that shares whole package stashes into a compartment.

This uses the same shared-package defense from the pg pull request
openwebwork/pg#1565.

The `snapshot_hooks` method can be called to record the hooks in the
shared packages once the compartment is fully set up but before the user
provided code runs, and `_clean_stash` then uses that to restore any
shared hook the user supplied code overwrites in place and strip all
hooks the user provided code adds (so a hook in a new `Mojo::Exception::Evil`
package is stripped, but `Mojo::Exception`'s overloads are left alone).
`snapshot_hooks` is called from the `AchievementNotification` task,
which is the only consumer that shares whole package stashes into a
compartment.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@drgrice1
drgrice1 force-pushed the safe-better-clean-stash branch from 415086c to 702e0b5 Compare October 23, 2026 10:43
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.

1 participant