Skip to content

portability PR: new test - #5035

Merged
josephjclark merged 4 commits into
v2-sync-finalizationfrom
v2-sync-finalization-new-test
Aug 7, 2026
Merged

portability PR: new test#5035
josephjclark merged 4 commits into
v2-sync-finalizationfrom
v2-sync-finalization-new-test

Conversation

@josephjclark

Copy link
Copy Markdown
Contributor

Testing something in CI for the portability PR

@github-project-automation github-project-automation Bot moved this to New Issues in Core Jul 31, 2026
@josephjclark
josephjclark force-pushed the v2-sync-finalization-new-test branch from cfb0b1a to 464b865 Compare July 31, 2026 16:27
@josephjclark josephjclark changed the title portabiliy PR: new test portability PR: new test Aug 5, 2026
@josephjclark

Copy link
Copy Markdown
Contributor Author

The PR fails because of this: OpenFn/kit#1497

I'll release the CLI and bump it on this branch

@josephjclark

Copy link
Copy Markdown
Contributor Author

Ok the new test passes... but deploy tests with --new are failing. Did that break in lastest CLI? 😭

I'll have to pause and investigate this in a little bit.

@josephjclark
josephjclark marked this pull request as ready for review August 7, 2026 08:08
@josephjclark
josephjclark merged commit 1437b87 into v2-sync-finalization Aug 7, 2026
5 of 6 checks passed
@josephjclark
josephjclark deleted the v2-sync-finalization-new-test branch August 7, 2026 08:08
@github-project-automation github-project-automation Bot moved this from New Issues to Done in Core Aug 7, 2026
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Both findings are confirmed as regressions introduced by this PR — the diffs explicitly show the removal of the project-scoping checks. Here is the final security review:

Security Review ⚠️

S0: Project-Scoped Data Access — FAIL

  • lib/lightning_web/controllers/workflow_controller.ex:68-91check_permissions/3 previously required project.id == workflow.project_id, but this PR removed that clause and replaced it with a cond that only checks the caller's :edit_workflow / :run_workflow on the path's project. A user with those permissions on any project (e.g. their own sandbox) can now POST /projects/{their_project}/workflows/{victim_workflow_id}/runs and execute a job (or trigger) belonging to another project — using that project's credentials and reading the resulting dataclip via the response body. get_run_steps/2 and retry_run/2 in the same file correctly retain verify_run_belongs_to_project/2 (line 279), showing the intended pattern that create_run/2 is missing.

  • lib/lightning_web/controllers/dataclip_controller.ex:113-175 (search/2) — the previous version passed project into NewManualRun.search_selectable_dataclips/5 for scoping; this PR dropped the project argument, and the new search_selectable_dataclips/4 (lib/lightning_web/live/workflow_live/new_manual_run.ex:22) calls Invocation.list_dataclips_for_job_with_cron_state(%Job{id: job_id}, ...) with no project_id filter. A user with :access_project on any project can supply another project's job_id and receive that project's dataclip results (names + IDs) and its next_cron_run_dataclip_id.

  • lib/lightning_web/controllers/dataclip_controller.ex:199-220 (show_for_run/2) — this PR removed the previous guard Runs.get_for_project(run_id, project.id) == nil -> json(conn, %{dataclip: nil, run_step: nil}). The action now calls Invocation.get_first_dataclip_for_run_and_job(run_id, job_id) and get_first_step_for_run_and_job(run_id, job_id) (lib/lightning/invocation.ex:120,138), both of which filter only by run_id/job_id, no project. A member of any project can read dataclip bodies and step data from runs belonging to any other project. The sibling update_name/2 correctly retains check_dataclip_in_project/2, further confirming this is a regression.

These are all S0 (project scoping) regressions — the checks that previously prevented cross-tenant access were explicitly removed in this branch. Test coverage in test/lightning_web/controllers/workflow_controller_test.exs and test/lightning_web/controllers/dataclip_controller_test.exs only exercises "no access to the path project," not "access to path project but resource belongs elsewhere," so the gap is untested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant