Repository navigation
fix: validate pipeline status task names against a set (CWE-407 DoS) - #36758
Merged
harshach merged 2 commits intoOct 31, 2026
Merged
Conversation
PUT /pipelines/{fqn}/status validated every taskStatus entry with a
linear scan over the pipeline's tasks, so one request cost
tasks x entries comparisons; /status/bulk cost tasks^2/2 for a status
naming every task. Neither list has a size limit, and a pipeline owner
sending large repeated bodies could occupy every QoS request slot and
deny service to all other API clients.
Collect the pipeline's task names into a HashSet once per request and
check each entry against the set, making both endpoints linear in
tasks + entries. A status carrying task entries for a pipeline without
tasks now gets the same 400 (Invalid task name) instead of a 500
(NullPointerException).
open-metadata#36763 moved the bulk-import history mocks onto insertMany; this keeps the two checks it did not carry over: the explicit single-row assertion on the captured version batch, and the unchecked-warning suppression on the raw ArgumentCaptor.
harshach
force-pushed
the
agent/ant-2026-1mwgxlc2-medium-cwe
branch
from
October 31, 2026 21:38
14e0de8 to
53f2fa7
Compare
Code Review ✅ Approved🟡 Medium risk · Set-based task validation changes pipeline status writes; mismatched task-name handling could reject otherwise valid pipeline updates. Replaces the per-entry linear scan of pipeline task names in status validation with a one-time HashSet lookup, so both VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
5 tasks done
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.
Describe your changes:
No linked issue: this PR fixes advisory ANT-2026-1MWGXLC2 (CWE-407, authenticated denial of service), and no public issue was opened for it. Labelled
skip-pr-checksaccordingly.PUT /api/v1/pipelines/{fqn}/statusvalidated everytaskStatusentry with a linear scan over the pipeline's tasks, so one request cost tasks × entries string comparisons;/status/bulkcost tasks²/2 for a status naming every task once. NeithertasksnortaskStatushas a size limit in the schema, and a pipeline owner — under the defaultOrganizationPolicyany authenticated user can claim an unowned pipeline — could send large, repeatedly-failing bodies that hold every QoS request slot, making the whole REST API return 503 while they are in flight.Collect the pipeline's task names into a
HashSetonce per request and check eachtaskStatusentry against the set, making both endpoints linear in tasks + entries. The 400Invalid task name …response is unchanged, and both endpoints now share one validation path instead of two. A status carrying task entries for a pipeline without tasks now gets the same 400 instead of a 500 (NullPointerException).Second commit (
53f2fa78f32): #36763 (merged to main while this PR was open) migrated the bulk-import history mocks onto batchedentityExtensionDAO.insertMany, fixing the redopenmetadata-service-unit-tests. Rebased onto it; where the two fixes overlapped, both behaviors were kept — main's version plus this branch's explicit single-row assertion on the captured version batch and the unchecked-warning suppression on the rawArgumentCaptorinBulkImportChangeEventMaskingTest. Test-only, no production code.Type of change:
High-level design:
N/A — small change: one repository method rewritten to be set-based, one call site rerouted through it, the per-name linear scan removed.
Tests:
Use cases covered
taskStatusentries all name the last of the pipeline's 14000 tasks: each task name is read exactly once; the request is linear, not tasks × entries./status/bulkshape): each task name is read exactly once, not tasks²/2.Invalid task name ….NullPointerException).Unit tests
openmetadata-service/src/test/java/org/openmetadata/service/jdbi3/PipelineStatusTaskValidationTest.java(new, 5 tests)PipelineRepository.validateTasks(Pipeline, List)100% instructions / 100% branches (jacoco via-Pstatic-code-analysis). The rest ofPipelineRepositoryis covered primarily by the integration tests below.entriesAgainstEveryTaskReadEachNameOncefails (expected <1> but was <14000>), and the counting tests cannot even call the old private instance method.Backend integration tests
PUT /pipelines/{fqn}/statusand/status/bulkendpoints keep their contract.PASSED — unit bucket and impacted pipeline ITs run locally.
1b4de42d3d0):EntityCacheLoadRaceTest, PipelineStatusComparisonTest, PipelineStatusTaskValidationTest— Tests run: 12, Failures: 0, Errors: 0, Skipped: 0.PipelineResourceIT, PipelineServiceResourceIT, PipelineStatusAuthorizationIT— Tests run: 459, Failures: 0, Errors: 0, Skipped: 52 (environment-dependent skips). Command in the section above; BUILD SUCCESS.53f2fa78f32, after test: read bulk import history from the shared version writer #36763 merged to main):EntityRepositoryBulkImportSecretsTest, BulkImportChangeEventMaskingTest, PipelineStatusTaskValidationTest, PipelineStatusComparisonTest— Tests run: 14, Failures: 0, Errors: 0, Skipped: 0; BUILD SUCCESS. Spotless clean.The other 19 IT classes the impact map lists for this area (smoke + messaging-pipelines-storage) were not run locally; they run in the merge queue.
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
UI screen recording:
Not applicable — backend-only change with no UI impact.
Checklist:
Fixes <issue-number>: <short explanation>— no issue exists for advisory ANT-2026-1MWGXLC2; labelledskip-pr-checks.Fixes #<issue-number>above. — none exists; see above.REVIEW.mdat commits1b4de42d3d0aefd999ac7c576d8923db409e764eand53f2fa78f3266f2a060d6b47899ce5b7ad93cac2(rebased ontoorigin/mainat370a82ff73d). Findings: one gap (the taskless-pipeline 400 behavior change was not test-locked) — fixed by addingentriesOnTasklessPipelineAreRefused. Zero remaining 🔴; no sibling sites share the old scan shape (getTasks().stream()appears nowhere else in main). The second commit is test-only (single-row assertion + warning suppression on top of main's test: read bulk import history from the shared version writer #36763).