apache / apache/shenyu

[BUG] RequestConfigHelper.buildPath does not URL-encode path/query values

Open Beginner friendly
#6,751 1 comment 0 reactions 0 assignees View on GitHub
feature: plugin priority: medium type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

- severity: Medium
- files: `shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/request/RequestConfigHelper.java:187-216`
- description: Path parameters substituted via `modifiedBasePath.replace("{{." + key + "}}", value)` and query via `queryBuilder.append(key).append("=").append(value)` with no URL encoding. Values containing `&`, `=`, `#`, `/`, `+`, `%` corrupt the path/query (e.g., `&` in a query value injects an extra parameter).
- impact: Malformed downstream URLs / query-parameter injection for values containing reserved characters.
- suggested_fix: URL-encode path segments and query values.
- confidence: High
- related_existing: none

---
_Identified during the 2026-08-02 deep re-scan; full list in [`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/request/RequestConfigHelper.java:187-216 and trace how buildPath receives path and query values. Verify behavior with values containing &, =, #, /, +, and %, then confirm that generated downstream paths and queries preserve each value without injection or corruption.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.