You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@texera.apache.org by "aglinxinyuan (via GitHub)" <gi...@apache.org> on 2026/08/12 23:58:41 UTC

[PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

aglinxinyuan opened a new pull request, #7605:
URL: https://github.com/apache/texera/pull/7605

   ### What changes were proposed in this PR?
   
   `cloneWorkflow` fetched the source workflow by `wid` and copied its content into a workflow owned by the caller, with no access check on the way in. Any authenticated REGULAR user could `POST /workflow/clone/<wid>` for a wid they hold no privilege on and receive a full copy of a private workflow's content — operator configurations, file paths and all.
   
   **Root cause.** Every sibling on this path guards; this one endpoint did not.
   
   | Endpoint | Guard |
   |---|---|
   | `retrieveWorkflow` | `hasReadAccess` directly |
   | `duplicateWorkflow` | `hasReadAccess` directly |
   | `cloneVersion` (`/version/clone/{vid}`) | inherits it via `retrieveWorkflowVersion` |
   | **`cloneWorkflow`** | **none** |
   
   That reads as an oversight rather than a decision. SECURITY.md states that REGULAR users "cannot access other users' private resources without granted permissions", so the endpoint contradicted the project's own declared model.
   
   **Before → after**
   
   ```
    caller with no privilege on wid
      |
      v                                   v
    POST /workflow/clone/{wid}          POST /workflow/clone/{wid}
      |                                   |
      |  (no check)                       +-- hasReadAccess(wid, uid)? --> no --> 403
      v                                   |
    fetchOneByWid(wid)                    v  yes (owner / READ grant / public)
      |                                 fetchOneByWid(wid)
      v                                   |
    full content copied to caller         v
                                        full content copied to caller
   ```
   
   The fix adds the same three lines the siblings use. `hasReadAccess` already returns true for public workflows, so the hub's clone button — the only caller, and always acting on a published workflow — is unaffected. A caller holding an explicit READ grant can still clone.
   
   ### Any related issues, documentation, discussions?
   
   Found while reviewing the clone-endpoint test in #7592, which this is stacked on; only the last commit belongs to this PR. Not filed as an issue, because SECURITY.md asks that security bugs not be reported through public issues.
   
   ### How was this PR tested?
   
   Two cases added to the existing `WorkflowResourceSpec`, and the pre-existing success case in #7592 now publishes its source first so it exercises the public path.
   
   | Test | Pins |
   |---|---|
   | `clone a private workflow the caller has been granted read access to` | the guard does not over-block a legitimate READ grant |
   | `reject a caller with no access to the source workflow` | 403, no copy reaches the caller, and no `WORKFLOW_USER_CLONES` row is written for the rejected attempt |
   
   Red before the guard, green after — with the guard reverted the rejection case fails and the other 69 pass, so it is the guard the test is pinning and not a fixture.
   
   ```
   sbt "WorkflowExecutionService/testOnly org.apache.texera.web.resource.dashboard.file.WorkflowResourceSpec"
   ```
   
   ```
   [info] Total number of tests run: 70
   [info] Tests: succeeded 70, failed 0, canceled 0, ignored 0, pending 0
   ```
   
   `scalafmtCheck` and `scalafix --check` pass for both `Compile` and `Test`.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7605:
URL: https://github.com/apache/texera/pull/7605#issuecomment-5274230898

   <!-- texera-benchmarks-comment -->
   ## ⚠️ Benchmark changes need a look
   
   🟢 0 better · 🔴 5 worse · ⚪ 10 noise (<±5%) · 0 without baseline
   
   > Compared against main `c35bdb1` benchmarked on **this same runner**, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.
   
   [Dashboard](https://apache.github.io/texera/dev/bench/) · [Run](https://github.com/apache/texera/actions/runs/31652831575)
   
   | | config | throughput | MB/s | latency | max Δ latest / 7d |
   |---|---|---:|---:|---:|---:|
   | 🔴 | bs=10 sw=10 sl=64 | 397 | 0.242 | 25,135/34,804/34,804 us | 🔴 +10.3% / 🔴 +113.4% |
   | 🔴 | bs=100 sw=10 sl=64 | 942 | 0.575 | 104,162/133,663/133,663 us | 🔴 +16.2% / 🔴 +23.5% |
   | ⚪ | bs=1000 sw=10 sl=64 | 1,090 | 0.665 | 915,823/1,012,738/1,012,738 us | ⚪ within ±5% / 🟢 -8.1% |
   
   <details><summary>Baseline details</summary>
   
   Latest main `c35bdb1` from same runner
   
   | config | metric | PR | latest main | 7d avg | Δ latest | Δ 7d |
   |---|---|---:|---:|---:|---:|---:|
   | bs=10 sw=10 sl=64 | throughput | 397 tuples/sec | 422 tuples/sec | 775.33 tuples/sec | -5.9% | -48.8% |
   | bs=10 sw=10 sl=64 | MB/s | 0.242 MB/s | 0.258 MB/s | 0.473 MB/s | -6.2% | -48.9% |
   | bs=10 sw=10 sl=64 | p50 | 25,135 us | 22,789 us | 12,743 us | +10.3% | +97.3% |
   | bs=10 sw=10 sl=64 | p95 | 34,804 us | 34,177 us | 16,310 us | +1.8% | +113.4% |
   | bs=10 sw=10 sl=64 | p99 | 34,804 us | 34,177 us | 18,926 us | +1.8% | +83.9% |
   | bs=100 sw=10 sl=64 | throughput | 942 tuples/sec | 975 tuples/sec | 1,001 tuples/sec | -3.4% | -5.9% |
   | bs=100 sw=10 sl=64 | MB/s | 0.575 MB/s | 0.595 MB/s | 0.611 MB/s | -3.4% | -5.9% |
   | bs=100 sw=10 sl=64 | p50 | 104,162 us | 102,303 us | 101,399 us | +1.8% | +2.7% |
   | bs=100 sw=10 sl=64 | p95 | 133,663 us | 115,056 us | 108,206 us | +16.2% | +23.5% |
   | bs=100 sw=10 sl=64 | p99 | 133,663 us | 115,056 us | 118,195 us | +16.2% | +13.1% |
   | bs=1000 sw=10 sl=64 | throughput | 1,090 tuples/sec | 1,085 tuples/sec | 1,026 tuples/sec | +0.5% | +6.2% |
   | bs=1000 sw=10 sl=64 | MB/s | 0.665 MB/s | 0.662 MB/s | 0.626 MB/s | +0.5% | +6.2% |
   | bs=1000 sw=10 sl=64 | p50 | 915,823 us | 913,848 us | 996,304 us | +0.2% | -8.1% |
   | bs=1000 sw=10 sl=64 | p95 | 1,012,738 us | 1,003,559 us | 1,042,531 us | +0.9% | -2.9% |
   | bs=1000 sw=10 sl=64 | p99 | 1,012,738 us | 1,003,559 us | 1,074,934 us | +0.9% | -5.8% |
   
   </details>
   
   <details><summary>Raw CSV</summary>
   
   ```csv
   config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
   0,10,10,64,20,504.26,200,128000,397,0.242,25134.80,34804.43,34804.43
   1,100,10,64,20,2123.84,2000,1280000,942,0.575,104161.88,133662.68,133662.68
   2,1000,10,64,20,18348.76,20000,12800000,1090,0.665,915822.63,1012737.84,1012737.84
   ```
   
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "aglinxinyuan (via GitHub)" <gi...@apache.org>.
aglinxinyuan merged PR #7605:
URL: https://github.com/apache/texera/pull/7605


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7605:
URL: https://github.com/apache/texera/pull/7605#issuecomment-5274193971

   <!-- backport-auto-label-report -->
   ### Backport auto-label report
   
   This `fix:` PR was checked against each actively-supported release branch. `release/*` labels drive the post-merge backport, so add or remove one to change where this fix lands.
   
   | Release branch | Analysis |
   | --- | --- |
   | ✅ `release/v1.2` | Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7. |
   
   _[Auto-label run](https://github.com/apache/texera/actions/runs/31652819692)._


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7605:
URL: https://github.com/apache/texera/pull/7605#issuecomment-5276362002

   Backport PR opened: draft #7625 (https://github.com/apache/texera/pull/7625) to `release/v1.2`, assigned to @aglinxinyuan — needs manual work because the cherry-pick conflicts.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #7605:
URL: https://github.com/apache/texera/pull/7605#issuecomment-5274195052

   <!-- texera-reviewer-suggestion -->
   ### Automated Reviewer Suggestions
   
   Based on the `git blame` history of the changed files, we recommend the following reviewers:
   
   - **Contributors with relevant context:** `@mengw15`
     You can notify them by mentioning `@mengw15` in a comment.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] fix(amber): guard cloneWorkflow with a read-access check [texera]

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #7605:
URL: https://github.com/apache/texera/pull/7605#issuecomment-5274262566

   ## [Codecov](https://app.codecov.io/gh/apache/texera/pull/7605?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 87.40%. Comparing base ([`5021bc6`](https://app.codecov.io/gh/apache/texera/commit/5021bc6f1a96d00cb26aa9c3a82c86fee67da0a9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`cf8d403`](https://app.codecov.io/gh/apache/texera/commit/cf8d403ef06e71772abc14b933c53279ad1eec3f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 4 commits behind head on main.
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@             Coverage Diff              @@
   ##               main    #7605      +/-   ##
   ============================================
   - Coverage     88.63%   87.40%   -1.24%     
   + Complexity     4346     4342       -4     
   ============================================
     Files          1177     1177              
     Lines         46894    46782     -112     
     Branches       5229     5191      -38     
   ============================================
   - Hits          41566    40890     -676     
   - Misses         3568     4107     +539     
   - Partials       1760     1785      +25     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | | *Carryforward flag |
   |---|---|---|---|
   | [access-control-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `70.00% <ø> (ø)` | | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [agent-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `86.87% <ø> (-11.75%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [amber](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `84.93% <100.00%> (+0.21%)` | :arrow_up: | |
   | [computing-unit-managing-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `50.24% <ø> (-10.15%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [config-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `65.97% <ø> (-11.35%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [file-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `69.05% <ø> (ø)` | | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [frontend](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `89.07% <ø> (-0.92%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [notebook-migration-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `78.89% <ø> (ø)` | | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [pyamber](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `97.51% <ø> (-0.01%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   | [workflow-compiling-service](https://app.codecov.io/gh/apache/texera/pull/7605/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `26.31% <ø> (-31.58%)` | :arrow_down: | Carriedforward from [c3c0bca](https://app.codecov.io/gh/apache/texera/commit/c3c0bcafa79983c1d621e1eb8b4282001d828416?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) |
   
   *This pull request uses carry forward flags. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/texera/pull/7605?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@texera.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org