Double URL Decoding of Query Parameters
まだ誰も着手していません。
評価
調査の方向性
RequestUtils.java の extractQuery、joinFormValues、decodeUrl から始め、そのフローを vertx-core HttpUtils::params が提供する HttpServerRequest のパラメーターと比較します。エンコードされた %25 のクエリ値を再現し、リテラルなパーセント記号とプラスを含む値が、2 回目の URL デコードなしで抽出を通過することを確認します。
索引モデルが issue の本文から書いたものです。
説明
Version
5.0.4
Context
When specifying query parameters that need to be URL-encoded, the extractQuery function of RequestUtils attempts URL decoding of the parameter value. This is incorrect, as parameters are already URL-decoded when retrieving them them from the HttpServerRequest (in vertx-core/io.vertx.core.http.impl.HttpUtils::params).
This behavior is likely to go undetected, as URL decoding will only lead to unexpected results if the decoded parameter value include + characters or fail if the parameter value contains %. We ran into the latter case.
Steps to reproduce
- Define an endpoint with a query parameter
- Send a request where the parameter value includes the
%character (encoded%25) - Observe
io.vertx.openapi.validation.ValidatorException: Can't decode URL value: ((name!=Invalid) AND (name!=Error) and (name like 'thi%') and ( name like '_hin_' ) ) or name=thing
at io.vertx.openapi.validation.RequestUtils.decodeUrl(RequestUtils.java:175) ~[vertx-openapi-5.0.4.jar:5.0.4]
at io.vertx.openapi.validation.RequestUtils.lambda$joinFormValues$6(RequestUtils.java:155) ~[vertx-openapi-5.0.4.jar:5.0.4]
[...]
at io.vertx.openapi.validation.RequestUtils.joinFormValues(RequestUtils.java:155) ~[vertx-openapi-5.0.4.jar:5.0.4]
at io.vertx.openapi.validation.RequestUtils.extractQuery(RequestUtils.java:131) ~[vertx-openapi-5.0.4.jar:5.0.4]
at io.vertx.openapi.validation.RequestUtils.extract(RequestUtils.java:87) ~[vertx-openapi-5.0.4.jar:5.0.4]
at io.vertx.openapi.validation.RequestUtils.extract(RequestUtils.java:55) ~[vertx-openapi-5.0.4.jar:5.0.4]
at io.vertx.ext.web.openapi.router.RouterBuilder.lambda$create$0(RouterBuilder.java:61) ~[vertx-web-openapi-router-5.0.4.jar:5.0.4]
at io.vertx.ext.web.openapi.router.impl.RouterBuilderImpl.lambda$createRouter$3(RouterBuilderImpl.java:131) ~[vertx-web-openapi-router-5.0.4.jar:5.0.4]
[...]
Caused by: java.lang.IllegalArgumentException: URLDecoder: Illegal hex characters in escape (%) pattern - Error at index 0 in: "')"
at java.base/java.net.URLDecoder.decode(URLDecoder.java:243) ~[?:?]
at io.vertx.openapi.validation.RequestUtils.decodeUrl(RequestUtils.java:173) ~[vertx-openapi-5.0.4.jar:5.0.4]
... 68 more
Do you have a reproducer?
No response
- 主要言語
- Java
- スター
- 15
- フォーク
- 19
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
eclipse-vertx/vertx-openapi のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
eclipse-vertx/vertx-openapi#137 · コメント 5 件 ·
-
enhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
eclipse-vertx/vertx-openapi#136 · コメント 1 件 ·
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
eclipse-vertx/vertx-openapi#122 · コメント 4 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
eclipse-vertx/vertx-openapi#93 · コメント 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
eclipse-vertx/vertx-openapi#92 · コメント 4 件 ·
eclipse-vertx/vertx-openapi の issue をすべて見る
似ている issue
-
good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
authorjapps/zerocode#808 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
checkstyle/sonar-checkstyle#625 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
quarkusio/quarkus-agent-mcp#302 ·
メンテナーはふだん 2 日以内に返信
-
build
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
MetricsHub/metricshub-community#1472 ·
メンテナーはふだん 1 日以内に返信