Skip to content

Restrict dashboard schema selection - #5688

Open
ydah wants to merge 1 commit into
rmosolgo:masterfrom
ydah:fix-dashboard-schema-selection
Open

Restrict dashboard schema selection#5688
ydah wants to merge 1 commit into
rmosolgo:masterfrom
ydah:fix-dashboard-schema-selection

Conversation

@ydah

@ydah ydah commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

GraphQL::Dashboard currently resolves the schema query parameter before the schema configured at mount time and calls constantize on any string value. A request such as ? schema=Kernel can therefore trigger arbitrary constant resolution, causing repeated NameError exceptions and potentially exposing information about constants in the application.

This also means that mount GraphQL::Dashboard, schema: "MySchema" does not reliably enforce the configured schema because the query parameter can override it.

The mount-time schema configuration is now treated as trusted configuration. Query parameters are only accepted when they match one of the configured schemas, and unknown values fall back to the configured default schema.
This prevents arbitrary constantization while preserving the intended mount configuration. Tests cover both allowed schema selection and rejected arbitrary values.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant