Skip to content

fix(frontend): harden SHOW object visibility#25571

Closed
tabVersion wants to merge 1 commit intomainfrom
ralph/show-object-visibility-hardening
Closed

fix(frontend): harden SHOW object visibility#25571
tabVersion wants to merge 1 commit intomainfrom
ralph/show-object-visibility-hardening

Conversation

@tabVersion
Copy link
Copy Markdown
Contributor

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR hardens user-visible SHOW metadata surfaces so a user with schema visibility alone cannot enumerate object names or secret references that they do not have object-level privilege for.

Changes:

  • Switch clear SHOW object-list handlers to ACL-aware schema iterators:
    • SHOW TABLES
    • SHOW INTERNAL TABLES
    • SHOW VIEWS
    • SHOW MATERIALIZED VIEWS
    • SHOW SOURCES
    • SHOW SINKS
    • SHOW SUBSCRIPTIONS
    • SHOW SECRETS
    • SHOW CONNECTIONS
    • SHOW FUNCTIONS
  • Make SHOW COLUMNS FROM <table/source> and SHOW INDEXES FROM <table> use the normal batch binder path instead of the system binder path, avoiding known-name metadata probing for hidden relations.
  • Add explicit object-visibility checks for SHOW COLUMNS FROM <sink/view> while preserving system-view column introspection.
  • Redact referenced secret names from visible connection output when the current user can see the connection but cannot see the referenced secret. In that case the output renders SECRET <redacted> instead of SECRET schema.secret_name.
  • Apply the same connection secret-ref redaction to rw_catalog.rw_connections.
  • Add targeted SQLLogicTest coverage for hidden object-list results, known-name probing, and connection secret-ref redaction.

Current limitation / follow-up:

  • During audit, rw_catalog.rw_sources was identified as a separate system-catalog surface that can still need visibility/secret-reference hardening. Iceberg-related catalog views should also be triaged in a follow-up pass.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

RisingWave now avoids exposing unauthorized object names through SHOW object-list commands and known-name SHOW COLUMNS / SHOW INDEXES probes. Visible connection metadata also redacts referenced secret names when the user cannot independently see the secret.

Local verification

Passed:

  • cargo fmt --all -- --check
  • cargo check -p risingwave_frontend
  • git diff --check -- src/frontend/src/handler/show.rs src/frontend/src/handler/create_connection.rs src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs e2e_test/ddl/show_object_privilege.slt

Attempted but blocked locally:

  • ./risedev d failed because local Java is 17 while the Maven build requires target release 21 (Fatal error compiling: error: invalid target release: 21).
  • ./risedev slt './e2e_test/ddl/show_object_privilege.slt' then failed because no RisingWave server was running (Connection refused (os error 61)).

@tabVersion tabVersion added user-facing-changes Contains changes that are visible to users ci/run-e2e-tests labels May 6, 2026
@github-actions github-actions Bot added the type/fix Type: Bug fix. Only for pull requests. label May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR hardens RisingWave frontend metadata exposure by making SHOW commands and connection parameter rendering respect object-level visibility (ACLs), preventing users with only schema USAGE from enumerating hidden object names or secret references.

Changes:

  • Switch several SHOW <objects> list handlers to use ACL-aware schema iterators (tables, views, mviews, sources, sinks, subscriptions, secrets, connections, functions).
  • Route SHOW COLUMNS / SHOW INDEXES through the normal batch binder path (instead of system binder) to block known-name probing for hidden relations; add explicit visibility checks for sink/view columns while preserving system-view introspection.
  • Redact secret references in connection output (both SHOW CONNECTIONS and rw_catalog.rw_connections) when the user can see the connection but not the referenced secret; add SLT coverage.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/frontend/src/handler/show.rs Makes SHOW object listings ACL-aware; hardens SHOW COLUMNS/SHOW INDEXES; integrates connection secret-ref redaction.
src/frontend/src/handler/create_connection.rs Adds connection param formatter that conditionally redacts secret refs based on user visibility.
src/frontend/src/catalog/system_catalog/rw_catalog/rw_connections.rs Applies the same secret-ref redaction to rw_catalog.rw_connections.
e2e_test/ddl/show_object_privilege.slt Adds end-to-end SLT coverage for hidden object listing/probing and secret-ref redaction.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/frontend/src/handler/show.rs
@tabVersion tabVersion force-pushed the ralph/show-object-visibility-hardening branch from cb661aa to 5bd48e0 Compare May 6, 2026 07:54
Copy link
Copy Markdown
Contributor Author

@tabVersion tabVersion left a comment

Choose a reason for hiding this comment

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

Found one CI-blocking issue in the new SLT fixture.

Comment thread e2e_test/ddl/show_object_privilege.slt Outdated
Make SHOW object lists and known-name metadata probes honor object visibility, and redact hidden secret refs in connection output.

Move connector-backed SHOW visibility coverage into source/sink/connection e2e suites so the DDL metadata-only test does not depend on external schema registry validation or madsim secret materialization.

Constraint: User requested the approved SHOW object visibility hardening plan.

Confidence: high

Scope-risk: narrow

Directive: Avoid leaking unauthorized object and secret names through SHOW commands.

Tested: git diff --check -- e2e_test/ddl/show_object_privilege.slt e2e_test/source_inline/connection/schema_registry.slt e2e_test/source_inline/kafka/secret_dep.slt e2e_test/sink/blackhole_sink.slt

Tested: cargo fmt --all -- --check

Tested: cargo check -p risingwave_frontend

Not-tested: local SLT because no RisingWave server is running on 127.0.0.1:4566.

Co-authored-by: OmX <omx@oh-my-codex.dev>
@tabVersion tabVersion force-pushed the ralph/show-object-visibility-hardening branch from 0901f89 to dcc251d Compare May 7, 2026 04:49
@tabVersion tabVersion closed this May 7, 2026
@tabVersion tabVersion reopened this May 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

) -> Result<Vec<Arc<IndexCatalog>>> {
let mut binder = Binder::new_for_system(session);
let mut binder = Binder::new_for_batch(session);
let relation = binder.bind_relation_by_name(&table_name, None, None, false)?;
Copy link
Copy Markdown
Contributor Author

Closing this PR in favor of #25584. GitHub's synthetic refs/pull/25571/head stayed stale at 5bd48e0bbc921946b2c19c2eb1b8bb1b803e9972 while the branch/PR API head advanced, so Buildkite could not fetch the commit it was asked to checkout. The replacement PR uses the same final code/tree on a fresh branch.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants