shenyu icon indicating copy to clipboard operation
shenyu copied to clipboard

[Task] Remove appSecret from sandbox-beforesign response header

Open Aias00 opened this issue 5 months ago • 2 comments

Description

SandboxServiceImpl.requestProxyGateway() builds a signing pre-image by appending appSecret to the path/timestamp/version string, then writes the full pre-image (including the raw appSecret) into the sandbox-beforesign HTTP response header. Since the format is deterministic (pathtimestampversion1.0.0), any recipient of the response can extract the appSecret by splitting on the literal version1.0.0. Affected File:

shenyu-admin/src/main/java/org/apache/shenyu/admin/service/impl/SandboxServiceImpl.java Proposed Change:

Strip the appSecret suffix from the value written to sandbox-beforesign. Only include the path, timestamp, and version components for debugging purposes: java// Before: response.addHeader("sandbox-beforesign", encode(signContent)); // includes appSecret // After: String debugPreimage = "path" + path + "timestamp" + timestamp + "version" + VERSION; response.addHeader("sandbox-beforesign", UriUtils.encode(debugPreimage, StandardCharsets.UTF_8)); Acceptance Criteria:

The sandbox-beforesign response header no longer contains appSecret. The sandbox-sign header (the final HMAC digest) is unaffected. The debugging intent of the header (showing what was signed, minus the secret) is preserved.

Task List

No response

Aias00 avatar Jun 26 '26 10:06 Aias00

👋 Hello @yuluo-yx

A new issue has been opened by @Aias00:

  • Title: [Task] Remove appSecret from sandbox-beforesign response header
  • Link: https://github.com/apache/shenyu/issues/6402

Please review when you have time. Thank you! 🙏

github-actions[bot] avatar Jun 26 '26 11:06 github-actions[bot]

i will try this

hengyuss avatar Jul 05 '26 08:07 hengyuss