[Bug]: json-xml-mediator policy accepts XML with more than one root element
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 76/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- go, json, xml
調査の方向性
json-xml-mediatorポリシーのXML解析経路から始めます。issueには、xml.Unmarshalが最初の要素を読み取り、後続の内容を無視すると記載されています。ポリシーの不正なXMLに関するテストを確認し、ルート要素が2つあるドキュメントのテストを追加します。そのリクエストが500を返し、バックエンドに転送されなければ完了です。
索引モデルが issue の本文から書いたものです。
説明
Please select the area the issue is related to
Gateway
Please select the aspect the issue is related to
Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)
Description
The policy parses XML with xml.Unmarshal, which reads the first element and stops. Anything after that element is ignored.
So a document with two root elements is not well-formed, yet it passes. The policy converts the first element, drops the rest and forwards the result. The backend never learns that part of the request was lost.
Malformed XML that fails inside the first element is rejected with 500, as the policy documentation describes for malformed payloads.
Expected Behaviour
The request is rejected with 500 and does not reach the backend.
Actual Behaviour
The gateway answers 200. The backend receives {"order":{"sku":"W-1"}}, and the second <order> is lost.
Steps to Reproduce
- Create a REST API with the policy on a POST operation:
{"name":"json-xml-mediator","version":"v1","params":{"downsteamPayloadFormat":"xml","upstreamPayloadFormat":"json"}} - Send
<order><sku>W-1</sku></orders>withContent-Type: application/xml. The gateway answers 500, and the backend is not called. - Send
<order><sku>W-1</sku></order><order><sku>G-2</sku></order>. The gateway answers 200, and the backend receives{"order":{"sku":"W-1"}}.
Severity Level of the Issue
Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)
Environment Details (with versions)
- Gateway versions: 1.1.0, 1.2.0 and latest
- Policy:
json-xml-mediatorv1.1.0, wso2/gateway-controllers main5b8e3367 - Upstream: a test service that records the request body
- 主要言語
- Go
- スター
- 85
- フォーク
- 142
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 250
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
wso2/api-platform のほかの issue
-
Area/Policies Aspect/API Severity/Major Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
wso2/api-platform#4465 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Invalid [api_portal.http_client.tls] value reports an error naming server.https対応中かも @Maheesh09 が今日担当しました。 オープンArea/DeveloperPortal Aspect/Configuration Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wso2/api-platform#4437 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
wso2/api-platform#4369 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: host-rewrite policy documentation lists fewer allowed host characters than the policy acceptsオープンArea/Policies Aspect/Other Severity/Trivial Type/Bug
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
wso2/api-platform#4355 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: A refused request's analytics event and traffic log lose the path the client called再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンArea/Gateway Aspect/API Severity/Minor Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
wso2/api-platform#4348 ·
メンテナーはふだん 1 日以内に返信
wso2/api-platform の issue をすべて見る
似ている issue
-
[Enhancement] platform-engineer: a definition change does not re-render running Applications; say how to roll it out対応中かも @anoop2811 が今日担当しました。 オープンneeds-triage type/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
review: medium
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
1lck/Lithe-IDEA#2432 ·
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
dsx-ai-factory/health-validation#368 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
keyxmakerx/Chronicle#2824 ·
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信