Repository navigation
Harden pipeline summary filter handling [2.0] - #36133
Conversation
Backport of open-metadata#36010 to the 2.0 branch. Route the pipeline summary, metrics, and execution/runtime trend filter values through bound SQL parameters (:psService, :psServiceType, :psStatus, :psTier) instead of interpolated string literals, so the escaping is consistent and complete across engines, and apply the standard VIEW_BASIC authorization check on the summary endpoint to match the metrics and trend endpoints. Adapted to 2.0: the DAO methods live in CollectionDAO (the TimeSeriesDAOs split came later on main), and the summary path's serviceType filters are bound here too since 2.0 interpolated them raw.
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
|
|
||
| OperationContext operationContext = | ||
| new OperationContext(entityType, MetadataOperation.VIEW_BASIC); | ||
| authorizer.authorize(securityContext, operationContext, getResourceContext()); |
There was a problem hiding this comment.
💡 Quality: No regression test for bound filters or summary VIEW_BASIC auth
This PR fixes a security bug: filter values that went straight into the SQL, and a missing authorization check on /v1/pipelines/summary. The repo's guidelines require bug fixes to ship with a failing test, but none was added. Nothing would catch a later change that puts service/serviceType/status/tier back into the SQL text, or that drops the authorizer.authorize(...) call. That is likely, since these queries are rebuilt by hand on each branch. Suggested fix: add an integration test in the existing pipeline resource IT. It should call /summary, /metrics, and the trend endpoints with filter values that contain single quotes (e.g. service=a' OR '1'='1) and check that no rows come back and the request does not fail with a SQL error. It should also call /summary as a user without VIEW_BASIC and expect a 403.
Was this helpful? React with 👍 / 👎
Code Review 👍 Approved with suggestions 0 closed / 1 findings🔴 High risk · Adding VIEW_BASIC authorization to pipeline summaries changes access decisions and could make summaries unavailable to users lacking that permission. Hardens pipeline summary, metrics, and trend filters by binding 💡 Quality: No regression test for bound filters or summary VIEW_BASIC auth📄 openmetadata-service/src/main/java/org/openmetadata/service/resources/pipelines/PipelineResource.java:851 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:1720-1734 📄 openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/PipelineRepository.java:2538-2552 This PR fixes a security bug: filter values that went straight into the SQL, and a missing authorization check on 🤖 Prompt for agentsVerificationRules 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 |
|



Backport of #36010 to the 2.0 release branch.
Route the pipeline summary, metrics, and execution/runtime trend filter values through bound SQL parameters (
:psService,:psServiceType,:psStatus,:psTier) instead of interpolated string literals, so the escaping is consistent and complete across engines, and apply the standardVIEW_BASICauthorization check on the summary endpoint to match the metrics and trend endpoints.Describe your changes:
Backport of the SQL filter hardening and summary authorization fix merged to
mainin #36010.Adapted to 2.0 because a cherry-pick does not apply:
CollectionDAO.javaon this branch (theTimeSeriesDAOs.javasplit came later onmain), so the new@Bindparameters were added to the 2.0 signatures.serviceTypequery-param value raw into its MySQL/Postgres filters (mysqlServiceTypeFilter/postgresServiceTypeFilter). Onmainthat value was already a bound parameter before Harden pipeline summary filter handling #36010, so the upstream diff did not touch it; here it is bound to:psServiceTypeas part of the backport — leaving it interpolated would keep open the exact injection Harden pipeline summary filter handling #36010 fixes.Fixes the same defect on 2.0 as #36010 fixes on main.
Type of change:
High-level design:
N/A — direct backport, see #36010.
Tests:
Use cases covered
service,serviceType,status, andtierfilter values containing quotes produce bound parameters, not SQL fragments./v1/pipelines/summaryendpoint now enforcesVIEW_BASIClike/metricsand the trend endpoints.Unit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
Manual testing performed
mvn -pl openmetadata-service compile→ BUILD SUCCESSmvn -pl openmetadata-service spotless:apply(no churn) andspotless:check→ passUI screen recording:
Not applicable — backend-only security backport.
Checklist:
REVIEW.md; the only behavioral delta beyond Harden pipeline summary filter handling #36010 is binding the 2.0 summary-pathserviceTypefilters, explained above.🤖 Generated with Claude Code
The filter and authorization changes appear sound, but the DAO signatures must satisfy the repository’s parameter limit before merging.
Findings
Summary
This backport replaces SQL literals with bound filter values and adds a
VIEW_BASICcheck before pipeline summaries are read.TeddyCr explicitly states that no regression tests were added intentionally, relies on merge-queue coverage, and identifies the upstream summary authorization test as a deferred follow-up. No separate test finding is reported.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Pipeline request] --> B[VIEW_BASIC check] B --> C[Build SQL filters] C --> D[DAO binds filter values] D --> E[(MySQL or PostgreSQL)]Reviews (1) · Last reviewed commit: "Merge branch '2.0' into backport/36010-2..." · Reviewed by Greptile