Skip to content

Mask secrets nested in collections, and validate outbound URLs, query source and attachment access - #33477

Merged
mohityadav766 merged 17 commits into
mainfrom
fix/secret-masking-and-validation-gaps
Sep 22, 2026
Merged

mohityadav766 merged 17 commits into
mainfrom
fix/secret-masking-and-validation-gaps

Conversation

@mohityadav766

@mohityadav766 mohityadav766 commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Describe your changes:

Five related gaps in how connection secrets are masked and how externally-supplied
values are validated before use. They are grouped because the first two share a root
cause and the third fixes two call sites of one helper.

Secret masking skipped collections. PasswordEntityMasker and SecretsManager only
recursed into OpenMetadata objects, so a password field declared inside a JSON-schema
array — mcpConnection.servers[].apiKey, testSuitePipeline.serviceConnections[] — was
never visited: a List is neither an OpenMetadata object nor an annotated leaf, so the
walk stopped. Those fields were returned unmasked and stored unencrypted.

Three fields were missing "format": "password". awsSessionToken, Fivetran
apiKey and GCP privateKeyId had no annotation, so PasswordAnnotator never emitted
@PasswordField and the masker treated them as ordinary strings — while their siblings
awsSecretAccessKey, apiSecret and privateKey were masked.

URLValidator never resolved the host. It matched a regex against the literal host
string, so anything not already written as a private IP passed: 0.0.0.0, localhost,
and any hostname pointing into the internal network. Separately, the governance webhook
sink checked only that its endpoint was non-empty and ran no URL validation at all.

queryStatementSource was interpolated verbatim into the FROM clause of the
Postgres query-history SQL, at both the test-connection check and the usage query parser,
which left the rest of the statement open to being rewritten.

Two attachment endpoints checked nothing. getAssetById and listAttachmentsByFqn
returned an attachment's filename, content type, size and parent entity link without
authorization, while downloadAsset and deleteAttachment resolved the parent entity
and checked VIEW_BASIC against it.

Type of change:

  • Bug fix

High-level design:

Touches 14 files across three modules, so briefly:

  • One traversal, three walkers. Rather than adding a collection branch to each of
    maskPasswordFields / unmaskPasswordFields / buildPasswordsMap, they now share a
    single walker with a visitor. That matters for correctness, not just duplication: mask
    and unmask are a matched pair, and if they derived collection keys differently,
    unmasking would fail to find a stored secret and would overwrite it with the mask
    value. Sharing the traversal makes divergence impossible. The same reasoning applies to
    SecretsManager, where encrypt and delete must derive identical secret ids or removing
    a service would strand its secrets in the store.

  • URLValidator keeps the regex as a pre-filter rather than replacing it, because it
    covers IPv6 unique-local fc00::/7, which InetAddress.isSiteLocalAddress() does not.
    A host that fails to resolve is allowed through rather than rejected — rejecting would
    make validation depend on DNS being reachable, which breaks air-gapped deployments and
    the existing tests that use non-resolving hostnames, and an unresolvable host is
    unreachable by the outbound request anyway. This narrows rather than removes the
    rebinding window: the name is resolved again when the request is issued. Pinning the
    validated address into the HTTP client would close it and is a larger change.

  • queryStatementSource is validated, not quoted. It names a relation, so it cannot
    be bound as a parameter. An allowlist of fixed names was rejected because the field's
    own schema description documents custom views; requiring an optionally
    schema-qualified identifier preserves that while leaving no room for anything else.
    Matched with fullmatch rather than an anchored pattern, since $ would also accept a
    trailing newline.

  • Attachment authorization is one extracted helper, so the four endpoints cannot drift
    apart again.

Tests:

Use cases covered

  • A password field nested in a JSON-schema array is masked on read and round-trips
    correctly through mask → unmask
  • 0.0.0.0, localhost and [::] are rejected as outbound URL targets
  • A host that does not resolve is still accepted
  • queryStatementSource accepts pg_stat_statements and
    my_schema.custom_pg_stat_statements, and rejects statement-rewriting input
  • Existing masking behaviour for non-nested fields is unchanged

Unit tests

  • Added testArrayNestedSecretIsMaskedAndRoundTrips to TestEntityMasker
  • Added testHostsResolvingToPrivateAddressesBlocked and
    testUnresolvableHostIsNotRejected to URLValidatorTest
  • Added ingestion/tests/unit/topology/database/test_postgres_query_statement_source.py

Both new Java tests were confirmed to fail against the unpatched code and pass with it.
Full run over the masker, secrets-manager and URL-validator suites: 74 tests, 0 failures.

Backend integration tests

  • Not added. The attachment change has no integration test — under the default policy
    the added check is a no-op, since OrganizationPolicy grants ViewAll on all
    resources to every user, so demonstrating it requires an IT that installs a
    restrictive policy first. Flagging rather than skipping quietly.

Ingestion integration tests

  • Not applicable — the ingestion change is pure input validation, covered by the unit
    test above.

Playwright (UI) tests

  • Not applicable (no UI changes).

Manual testing performed

Covered by the unit tests above. The Python test file was written but not executed
locally
— this worktree has no virtualenv and the system interpreter lacks the
dependencies; the validator logic itself was verified by executing the shipped source
directly against the accept/reject cases listed above.

UI screen recording / screenshots:

Not applicable.

Checklist:

  • I have read the CONTRIBUTING document.
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: no migration script is needed — the change is additive
    annotation only. Worth noting though: values already stored for those three fields
    remain unencrypted at rest until the service is next saved. They are masked from API
    responses immediately, and plaintext reads back correctly because
    Fernet.isTokenized returns false for it, so nothing breaks — but a re-encryption
    pass would be a reasonable follow-up.
  • I have added tests (unit / integration / Playwright as applicable) and listed them above.
  • I have added a test that covers the exact scenario we are fixing.

🤖 Generated with Claude Code

RetriggerConfidence Score: 3/5

The PR does not appear safe to merge while collection-secret identity and outbound DNS rebinding remain unresolved.

Findings

  1. P1 DNS rebinding bypasses validation ▶
  2. P1 Indexes misassign collection secrets ▶
  3. P1 Security DNS Rebinding Bypasses Validation ▶
  4. P1 Security Redirect Targets Skip Validation ▶
Summary

This PR expands collection-aware secret masking and storage, annotates previously unprotected credentials, validates PostgreSQL query-history relation names, strengthens outbound URL handling, and applies parent-entity authorization to attachment metadata endpoints.

  • Collection secrets now use unique element names where possible and share key derivation across masking and secret storage.
  • PostgreSQL custom query sources support safely validated quoted and unquoted relation identifiers.
  • Attachment listing now authorizes every distinct parent represented by the lookup.
  • Outbound webhook requests use a connection-time policy and no longer follow redirects.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Stored connection configuration] --> B[Collection walker]
  B --> C[Derive unique-name or positional key]
  C --> D[Mask API response]
  C --> E[Restore masked values on update]
  C --> F[Encrypt or delete external secret]

  G[Configured outbound URL] --> H[Save-time validation]
  H --> I[Filtered HTTP client]
  I --> J[Connection-time validation]
  J --> K[Outbound request]
Loading

Reviews (8) · Last reviewed commit: "Merge branch 'main' into fix/secret-mask..."

mohityadav766 and others added 5 commits September 17, 2026 14:24
…tion fields

The masker and the secrets manager only recursed into OpenMetadata objects,
so a password field declared inside a JSON-schema array - such as
mcpConnection.servers[].apiKey - was skipped: a List is neither an
OpenMetadata object nor an annotated leaf, so the walk stopped there. Those
fields were returned unmasked and stored unencrypted.

Masking, unmasking and password-map building now share one traversal, so
they derive identical keys for the same field. Encrypt and delete derive
identical secret ids for the same collection element, so removing a service
no longer leaves its secrets behind in the store.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… as password fields

These three fields carried no "format": "password", so PasswordAnnotator
never emitted @PasswordField and the masker treated them as ordinary
strings, while their siblings awsSecretAccessKey, apiSecret and privateKey
were masked.

Generated TypeScript is unaffected, since "format": "password" does not
change the emitted TS type, and generated Python is not committed - so no
regenerated output accompanies this change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nance webhook endpoint

URLValidator matched a regex against the literal host string and never
resolved it, so anything not already written as a private IP passed:
0.0.0.0, localhost, and any hostname pointing into the internal network. It
now also rejects a host whose resolved addresses are unspecified, loopback,
link-local, site-local or multicast. The regex stays as a cheap pre-filter
because it covers IPv6 unique-local fc00::/7, which isSiteLocalAddress()
does not.

A host that fails to resolve is allowed through rather than rejected.
Rejecting would make validation depend on DNS being reachable, which breaks
air-gapped deployments and the existing tests that use non-resolving
hostnames, and an unresolvable host is unreachable by the outbound request
anyway.

This narrows rather than removes the rebinding window: the name is resolved
again when the request is issued. Pinning the validated address into the
HTTP client would close it and is a larger change.

The governance webhook sink checked only that its endpoint was non-empty; it
now runs the same validation as the event-subscription webhooks.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
queryStatementSource was interpolated verbatim into the FROM clause of the
query-history SQL, at both the test-connection check and the usage query
parser, which left the rest of the statement open to being rewritten.

The value names a relation, so it cannot be bound as a parameter. It now has
to be an optionally schema-qualified identifier, which preserves the
documented custom-view support ("my_schema.custom_pg_stat_statements").
Matched with fullmatch rather than an anchored pattern, since "$" would also
accept a trailing newline.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
getAssetById and listAttachmentsByFqn returned an attachment's filename,
content type, size and parent entity link without checking anything, while
downloadAsset and deleteAttachment resolved the parent entity and checked
VIEW_BASIC against it. Both now run that same check, extracted into one
helper rather than repeated.

Under the default policy this changes nothing, since OrganizationPolicy
grants ViewAll on all resources to every user. It matters for deployments
that layer restrictive or domain-scoped policies on top.

listAttachmentsByFqn gains a SecurityContext parameter. Every asset it
returns hangs off the same FQN, so one check covers the page.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mohityadav766
mohityadav766 requested review from a team as code owners September 17, 2026 08:57
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added backend safe to test Add this label to run secure Github workflows on PRs labels Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

ulixius9
ulixius9 previously approved these changes Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Generated Sources Auto-Updated

The generated TypeScript types (src/generated/) and dereferenced JSON
schemas (src/jsons/, public/jsons/) have been automatically updated
based on JSON schema changes in this PR.

Comment on lines 86 to 93
private static InetAddress[] resolve(String host) {
try {
return InetAddress.getAllByName(host);
} catch (UnknownHostException e) {
LOG.debug("Host [{}] did not resolve; skipping address-level SSRF checks", host, e);
return new InetAddress[0];
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security DNS rebinding bypasses validation

Allowing resolution failures and discarding the validated addresses leaves the SSRF protection bypassable. An attacker-controlled hostname can be unresolved or public during validation, then resolve to a private address when WebhookSinkProvider independently connects using the original hostname. The outbound client must use the validated address or repeat equivalent validation at connection time.

How this was verified: The validator resolves with InetAddress.getAllByName and returns an empty result on failure, while the webhook later constructs its request from the original endpoint hostname without retaining those addresses.

Comment on lines +250 to 258
private void walkCollection(Collection<?> collection, String key, PasswordFieldVisitor visitor) {
int index = 0;
for (Object element : collection) {
if (isTraversable(element)) {
walkPasswordFields(element, createKey(key, String.valueOf(index)), visitor);
}
index++;
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Indexes misassign collection secrets

Collection positions are not stable secret identities. During PUT and PATCH, the password map is built from the original configuration and applied to the updated configuration using keys such as servers.0.apiKey. Reordering or inserting masked elements therefore assigns the old secret at that position to a different server before it is encrypted and persisted. Removed or renumbered elements can also leave obsolete indexed entries in an external secret store because updates do not delete them. Match elements by a stable identity and clean up obsolete secret IDs rather than deriving identity solely from the index.

@github-actions

Copy link
Copy Markdown
Contributor

The Python checkstyle failed.

Please run make py_format and py_format_check in the root of your repository and commit the changes to this PR.
You can also use pre-commit to automate the Python code formatting.

You can install the pre-commit hooks with make install_test precommit_install.

py-checkstyle fails on UP045: this module carries no `typing` imports since
the typing modernization, and the new annotation reintroduced one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Comment on lines +64 to +66
* <p>Resolving here narrows the hole rather than closing it. The name is resolved again when the
* request is issued and may answer differently by then; only pinning the validated address into
* the HTTP client defeats DNS rebinding, which is a larger change than this fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security DNS Rebinding Bypasses Validation

Resolving the hostname only during validateURL does not secure the later request. User-configurable webhook, OAuth token, and validation URLs are passed to HTTP clients by hostname and resolved again when sent. An attacker-controlled DNS name can answer with a public address here and an internal address at request time, allowing the new private-address check to be bypassed. The request must use the validated address while preserving the original Host and TLS identity, or perform an equivalent connection-time address check.

How this was verified: The validator discards the resolved addresses, while outbound callers later pass the original hostname to client.target(...) or HttpClient.send(...), causing an independent resolution.

Comment on lines +180 to +182
// This sink posts from the server's own network position, so it applies the same outbound-URL
// validation as the event-subscription webhooks.
URLValidator.validateURL(webhookConfig.getEndpoint().toString());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 security Redirect Targets Skip Validation

Validating the configured webhook endpoint does not validate destinations reached through redirects. This provider uses an otherwise-default Jersey client, which follows redirects, so a public endpoint can return a method-preserving redirect to a private or link-local URL and cause the server to contact it without running URLValidator on the Location. Disable automatic redirects or handle each redirect explicitly and validate every destination.

How this was verified: The provider validates only webhookConfig.getEndpoint(), creates a default redirect-following client, and contains no validation of redirect Location values before sending.

@github-actions

github-actions Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 72%
72.44% (103513/142884) 57.53% (62990/109482) 58.61% (20634/35205)

mohityadav766 and others added 4 commits September 19, 2026 00:35
…he governance webhook endpoint"

This reverts commit 4369d5e.
Keying by index meant a stored secret was restored onto whichever element
happened to occupy that position. With servers [alpha, beta], deleting alpha
and saving sends [beta] with a masked apiKey; beta lands at index 0 and was
handed alpha's key, while its own was lost. Reordering swapped them the same
way. Before collections were traversed at all the value came back in plain
text, so this is a regression introduced by that traversal rather than a
pre-existing problem.

Elements that expose a non-empty getName() are now keyed by it, and only
those without one fall back to position. The same key feeds the secret ids
built for external secret managers, so encrypt and delete stay aligned.

Both scenarios are covered by tests that fail against positional keys.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The first version of the check took bare identifiers only, which would have
rejected configurations that were previously valid: Postgres needs quoting
for relation names that are case-sensitive or contain spaces, and the field
is documented as a fully qualified name of a view or table.

A double-quoted part is now accepted on either side of the dot. It cannot be
used to break out, since the closing quote has to be followed by
end-of-string or ".<part>" and "" is an escaped quote, so the value stays a
relation reference. Also switches the annotation to "str | None" for ruff.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…irst

Assets are looked up by FQN and asset type, neither of which pins the parent
entity type, so a single page can span more than one parent entity.
Authorizing the first asset therefore did not establish access to the rest
of the response. Each distinct parent is now authorized.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mohityadav766

Copy link
Copy Markdown
Member Author

Pushed four commits addressing the review.

Reverted the URL-validation commit (a5ff83aefa). Outbound URL validation is left entirely to #33439 — see the thread on URLValidator for why the original was worse than the gap it closed.

Collection secrets are keyed by element identity, not position (8c29da29db). Details in the PasswordEntityMasker thread. This was the most serious thing in the review and it was a regression this PR introduced.

Quoted relation names are accepted again (86ca38222f). The first version took bare identifiers only, which would have rejected configurations that were previously valid — Postgres needs quoting for names that are case-sensitive or contain spaces, and the field is documented as a fully qualified relation name. A double-quoted part is now allowed on either side of the dot. It cannot be used to break out: the closing quote has to be followed by end-of-string or .<part>, and "" is an escaped quote. Verified that "Audit Schema"."Query Log", history."select" and "has""escaped" are accepted while "x"; DROP TABLE y--, "unterminated, "a" OR 1=1 and "a"."b"."c" are rejected.

Attachment listings authorize every distinct parent (e3bd87d1b6). Correct that FQN plus asset type does not pin the parent entity type, so a page can span parents and the first asset does not speak for the rest.

On DNS rebinding: not addressed here, because the code it applied to is reverted. Worth carrying into #33439 though — resolving at validation time does not bind the address the client later connects to, and closing it properly means pinning the resolved address into the HTTP client rather than re-resolving by hostname.

On redirects skipping validation: same, it belongs with #33439. The Jersey client in WebhookSinkProvider follows redirects by default, so validating the configured endpoint does not constrain where the request ends up.

Checks: 59 Java tests green across the masker, secrets-manager and URL-validator suites, spotless:check clean, and ruff check / ruff format clean on the changed Python.

Two things still open that I have not resolved:

  • No linked issue, so the PR metadata check stays red.
  • The attachment change has no integration test. Under the default policy the added check is a no-op, since OrganizationPolicy grants ViewAll on all resources to every user, so exercising it needs an IT that installs a restrictive policy first. Flagging rather than leaving it implied.

…t is unique

Keying purely by name traded one failure for another. The mcpServerConfig
schema requires a name but does not constrain it to be unique, so two
elements sharing one produced the same key: the second overwrote the first
in the password map and in the secret store, and both entries then restored
to the survivor's value.

Keys are now resolved per collection. A name is used only where it occurs
once; duplicates and unnamed elements fall back to position, prefixed so a
positional key can never collide with a name. Position is the best available
answer for elements that are genuinely indistinguishable - what it must not
do is silently merge them.

Covered by a test that fails without the uniqueness check, restoring
beta's key onto alpha.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-21T15:43:34Z)

Blocked the queue: integration-tests-mysql-elasticsearch

@github-actions

Copy link
Copy Markdown
Contributor

🚦 Removed from the merge queue — failed_checks (2026-09-21T21:25:49Z)

Blocked the queue: playwright-summary

@mohityadav766

mohityadav766 commented Sep 21, 2026 •

Copy link
Copy Markdown
Member Author

Merged latest main (c4c789bb28) and re-ran.

On the visual-regression failure — it is the known data-quality flake, not this PR.

VisualRegression/staticPages.spec.ts was already red on main before this branch existed. #33662 describes the cause: data-quality.png had been recorded mid-load, so the committed baseline was the page's skeleton placeholders, and CI had been failing it at 16708 pixels. That fix waits for the skeletons to clear and masks the Data Health donut counts, which vary by environment. It merged yesterday as ab05c879bb and was not on this branch — the merge above brings it in.

This PR cannot affect that page:

  • It touches nothing named data-quality, VisualRegression, staticPages or playwright.
  • Its only UI files are 75 generated connection schemas under public/jsons/connectionSchemas/, which drive ingestion connector config forms — not the Data Quality page.
  • The diff is 16708 pixels (ratio 0.02) — the exact figure fix(e2e): screenshot the data-quality page once it has loaded #33662 cites as what CI had been red at. Same page, same count, on a branch that does not touch it.

(Corrected: an earlier version of this comment described the failure as a timeout rather than a pixel diff. It is a pixel diff; the 15000ms is the retry window it kept differing through. The matching pixel count is the stronger evidence.)

No snapshot was re-baselined, deleted or skipped here; the fix comes entirely from main.

Still green locally after the merge: 60 Java tests across the masker, secrets-manager and URL-validator suites, spotless:check clean, and ruff check / ruff format clean on the changed Python.

On Validate PR Metadata — this one I cannot clear. It needs a linked issue, and there is no existing issue this PR fixes. The closest, #32693, is a different root cause: it is about IngestionPipelineBuilder.addDefinedConfig only converting for DBT so configs stay LinkedHashMap, whereas this PR adds Collection traversal and deliberately does not add Map traversal. Linking it would auto-close a bug that remains unfixed.

A maintainer needs to either add the skip-pr-checks label, or create/link a tracking issue and set its fields in the Shipping project — the bot notes those fields live on the issue and that the check has to be re-run afterwards.

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ SSO Login Nightly — PASSED

View workflow run · Commit 2d5070c

Provider                        Status        Pass   Fail  Flaky   Skip    Duration
------------------------------  -----------  -----  -----  -----  -----  ----------
basic                           pass             4      0      0      0      0m 21s
ldap                            pass             4      0      0      0      0m 19s
keycloak-oidc-confidential      pass             6      0      0      0      0m 35s
keycloak-oidc-public            pass             6      0      0      0      0m 33s
msal-mock                       pass             4      0      0      0      0m 19s
auth0-mock                      pass             3      0      0      0      0m 22s
okta                            skipped          -      -      -      -           -
keycloak-azure-saml             pass             1      0      0      0      0m 19s
keycloak-azure-saml-crosssite   skipped          -      -      -      -           -

Totals: 28 passed · 0 failed · 0 flaky · 0 skipped · duration 2m 52s

@mohityadav766

Copy link
Copy Markdown
Member Author

playwright-visual-regression is green after the main merge, as expected — #33662 was the fix and it is now on this branch.

playwright-summary is red, but not for a test failure. The job says so itself:

Classification: infrastructure_failure
Tests: 4546 total, 0 failed, 7 passed on retry, 1 skipped
PLAYWRIGHT_RESULT: success
REPORT_COVERAGE_OUTCOME: failure
##[error]0 Playwright test failure(s); 1 CI/reporting failure(s)
         (no test failures — CI infrastructure/reporting problem, not this change)

The failing step is verify_playwright_coverage.py:

Playwright coverage mismatch: 65 missing, 0 unexpected, 0 duplicate plans, and 0 duplicate executions

So it is an accounting gap, not a failure: the plan carried 4546 tests and the timing artifacts account for 4481 (executedTests: 4480, mode full), leaving 65 unaccounted. Every individual Playwright shard reported success — the only red job in the workflow is the summary.

I re-ran it once with --failed; that re-ran only the summary job against the same cached artifacts and reproduced the same count, so it says nothing about whether a full re-run would clear it. I have not triggered a full-suite re-run, since that is a large CI spend on a guess and the gap looks like plan-versus-execution bookkeeping rather than anything this branch does.

Worth noting it is not unique to this PR — #33734 currently shows the same playwright-summary failure, while other open PRs are green on it. If that is a known issue, this check can probably be treated accordingly; if not, it may be worth a look independently of this PR.

@gitar-bot

gitar-bot Bot commented Sep 22, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 closed / 2 findings

🔴 High risk · Adds authorization checks and outbound URL validation across backend services

Fixes secret masking for nested collection fields, validates outbound URLs and query sources, and enforces authorization on attachment metadata endpoints. Duplicate collection element names that could collide on secret key have been resolved.

✅ 2 closed
✅ Edge Case: Duplicate collection element names collide on secret key

📄 openmetadata-service/src/main/java/org/openmetadata/service/util/ReflectionUtil.java:97-111 📄 openmetadata-service/src/main/java/org/openmetadata/service/secrets/masker/PasswordEntityMasker.java:250-260 📄 openmetadata-service/src/main/java/org/openmetadata/service/secrets/SecretsManager.java:450-461
getCollectionElementKey keys a collection element by its getName() value, falling back to index only when the name is empty. The mcpServerConfig schema requires name but does not constrain it to be unique, so two servers named the same produce identical secret keys. On encrypt, buildSecretId(..., elementKey) is the same for both, so the second element's secret overwrites the first in the store and both resolve to the same value on decrypt; on unmask, buildPasswordsMap puts both under the same fieldKey, so the last one wins and the other server is restored with the wrong key. This trades the reorder/delete bug (correctly fixed) for a silent secret swap whenever names duplicate. Consider appending the index as a tiebreaker for elements sharing a name, or validating name uniqueness before keying.

Closed: Edge Case: Index-based secret keys misassign on collection edits

📄 openmetadata-service/src/main/java/org/openmetadata/service/secrets/masker/PasswordEntityMasker.java:250-257 📄 openmetadata-service/src/main/java/org/openmetadata/service/secrets/SecretsManager.java:450-461
The new collection traversal in PasswordEntityMasker (walkCollection) and SecretsManager (forEachTraversableElement) derives per-element keys/secret-ids purely from the element's positional index (createKey(key, index) / buildSecretId(..., index)). Unmasking maps a masked placeholder back to passwordsMap[<field>.<index>] built from the original config. If a user inserts, removes, or reorders array elements (e.g. adds a new mcpConnection.server ahead of existing ones) while leaving other entries masked, the index no longer identifies the same element: the masked entry at index i is restored with the secret that belonged to whatever occupied index i in the original config, silently assigning the wrong secret or persisting a stale one. This is a limitation of the new approach (not a regression, since these fields were previously stored in plaintext), but worth documenting/guarding. A stable per-element identity (e.g. a name/id key when available) would avoid the misassignment.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

🤖 Auto-approval Not enabled · Set up

Options

Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@sonarqubecloud

Copy link
Copy Markdown

This branch was previously deployed

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

Labels

backend safe to test Add this label to run secure Github workflows on PRs

Projects

Status: Done ✅

Development

Successfully merging this pull request may close these issues.

4 participants