Unified · Split
| @@ -251,7 +251,12 @@ describe("SDK v2 Executor MCP assembly", () => { · 250 unmodified lines | ||
| 251 | 251 | expect(isInputRequiredResult(first)).toBe(true); |
| 252 | 252 | if (!isInputRequiredResult(first) || !first.requestState) return; |
| 253 | 253 | |
| 254 | − const tampered = `${first.requestState.slice(0, -1)}x`; | |
| 254 | + // Corrupt an interior character: changing the final one can only touch | |
| 255 | + // discarded base64url padding bits, which lenient decoders (Bun) drop — | |
| 256 | + // the decoded bytes would be identical and the signature would verify. | |
| 257 | + const middle = Math.floor(first.requestState.length / 2); | |
| 258 | + const swapped = first.requestState[middle] === "A" ? "B" : "A"; | |
| 259 | + const tampered = `${first.requestState.slice(0, middle)}${swapped}${first.requestState.slice(middle + 1)}`; | |
| 255 | 260 | await expect( |
| 256 | 261 | manualToolCall(client, { |
| 257 | 262 | name: "execute", |