Guard material writes in ExpGeneratorHelper with UpdatePermission - #8043
ankurjuneja wants to merge 5 commits into
Conversation
labkey-jeckels
left a comment
There was a problem hiding this comment.
Also see the calls to addProvenance, addProvenanceInputs, and addProvenanceOutputs around line 463. Should they get read checked too?
labkey-jeckels
left a comment
There was a problem hiding this comment.
Parallel finding probably worth addressing at the same time:
Issue: handleMaterial — the globally-resolving lookup that makes this bug possible — is also called from handleRun for output materials, which flow into saveSimpleExperimentRun. That method does outputMaterial.setSourceApplication(protApp2); outputMaterial.setRun(run); Table.update(...) with no permission check and no isOperationPermitted check anywhere in its body.
Why it matters: The experiment-saveBatch / assay-save APIs reach the identical lineage rewrite on an arbitrary cross-container material through a different entry point. Fixing only the ExpGeneratorHelper write site closes the provenance door while leaving the wider one open, so the security goal in the PR title isn't actually met system-wide. (Pre-existing, not introduced here — but it is the same defect class and shares the same root cause.)
Suggestion: Either push the guard down into handleMaterial (which already knows the resolved material and the ViewContext user) so every caller inherits it, or extract the assertCanEditLineage helper somewhere shared and call it from saveSimpleExperimentRun before the Table.update. If that's deliberately out of scope for this PR, file a follow-up issue and say so in the description.
| pvs.addProvenanceInputs(container, stepApp, action.getObjectInputs()); | ||
| pvs.addProvenanceOutputs(container, stepApp, action.getObjectOutputs()); |
There was a problem hiding this comment.
Similar concerns on these inputs, which can come from ProvenanceController.StopRecordingAction
Rationale
Tightens permission handling in experiment run creation, with added provenance recording test coverage.
Related Pull Requests
Changes