- severity: High
- files:
shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/response/ShenyuMcpResponseDecorator.java:59-79
- description:
super.writeWith(Flux.from(body).doOnNext(buffer -> { byte[] bytes = ...; buffer.read(bytes); ... })) calls DataBuffer.read(byte[]), advancing the reader index to the end, before super.writeWith writes the buffer. ServerHttpResponseDecorator.writeWith writes from the current reader index, so it writes zero bytes — the actual HTTP response body sent downstream is empty.
- impact: The forwarded HTTP response body is lost/empty; downstream receives no body while only the captured future sees the content.
- suggested_fix: Capture bytes via
DataBufferUtils.clone(buffer) or read a copy without advancing the original buffer; release after writing.
- confidence: Medium
- related_existing: none
Identified during the 2026-08-02 deep re-scan; full list in docs/scan2-2026-08-02/00-consolidated-critical-high.md.
shenyu-plugin/shenyu-plugin-mcp-server/src/main/java/org/apache/shenyu/plugin/mcp/server/response/ShenyuMcpResponseDecorator.java:59-79super.writeWith(Flux.from(body).doOnNext(buffer -> { byte[] bytes = ...; buffer.read(bytes); ... }))callsDataBuffer.read(byte[]), advancing the reader index to the end, beforesuper.writeWithwrites the buffer.ServerHttpResponseDecorator.writeWithwrites from the current reader index, so it writes zero bytes — the actual HTTP response body sent downstream is empty.DataBufferUtils.clone(buffer)or read a copy without advancing the original buffer; release after writing.Identified during the 2026-08-02 deep re-scan; full list in
docs/scan2-2026-08-02/00-consolidated-critical-high.md.