Skip to content

Return 400 for invalid UTF-8 query parameters - #486

Merged
geemus merged 1 commit into
masterfrom
fix/invalid-utf8-query-parameter
Sep 29, 2026
Merged

geemus merged 1 commit into
masterfrom
fix/invalid-utf8-query-parameter

Conversation

@ydah

@ydah ydah commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

OpenAPI 3 query validation can raise ArgumentError when a query value contains invalid UTF-8 bytes and a string pattern is checked. The exception escaped validation, causing a server error for malformed query values.

Convert the exception to Committee::InvalidRequest so the middleware returns a client error, and add regression coverage for a percent-encoded invalid UTF-8 value.

Fixes: #268

@ydah
ydah force-pushed the fix/invalid-utf8-query-parameter branch from 7388950 to 45f632b Compare September 24, 2026 07:20

@geemus geemus left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, thanks!

@geemus
geemus merged commit ae751f7 into master Sep 29, 2026
9 checks passed
@geemus
geemus deleted the fix/invalid-utf8-query-parameter branch September 29, 2026 22:22
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.

Failing for garbage(URL encoded) value in query parameter

2 participants