Repository navigation
test: replace WAF-blocked payloads in ErrorHandling special-case tests - #399
Merged
cs-raj merged 1 commit intoNov 23, 2026
Conversation
Error_XSSAttempt_SafelyHandled sends '<script>alert("xss")</script>' as a
where() value. The Cloudflare WAF on dev11 blocks it with an HTML 403
page at random, so the SDK fails with "SyntaxError: Unexpected token '<'"
(passed in #770 and #772-#775, failed in #771 and #776-#781 on the same
commit). Error_SQLInjectionAttempt_SafelyHandled sends
"'; DROP TABLE entries; --", the same string that was blocked in
WhereOperators on Nov 16.
Same approach as 45a5af5: replace both with URL metacharacter values
(&, =, %, +, #, space) that already pass the WAF in WhereOperators and
are what can actually corrupt a query string the SDK builds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
vaishnavi-kedar-cstk
approved these changes
Nov 23, 2026
cs-raj
merged commit Nov 23, 2026
bf91475
into
feature/comprehensive-integration-tests
9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Error_XSSAttempt_SafelyHandledintest/integration/ErrorTests/ErrorHandling.test.jsfails at random insdk-js-cda-daily-sanity:It sends
<script>alert("xss")</script>as awhere()value. The Cloudflare WAF on dev11 sometimes blocks that request and returns an HTML 403 page, soresponse.json()throws. Same commit (45a5af5), different results:45a5af5already fixed this forWhereOperatorsandExistsSearchOperatorsbut missed these two tests.Error_SQLInjectionAttempt_SafelyHandledsends'; DROP TABLE entries; --, the exact string that was blocked inWhereOperatorson Nov 16, so it is at risk too.Fix
Same approach as
45a5af5: replace both tests with URL metacharacter values, which are what can actually break a query string the SDK builds:Error_QueryDelimitersInValue_TreatedAsLiteral:foo&limit=100must not inject a second param (also checks no more than 3 entries come back).Error_PercentPlusHashInValue_HandledSafely:100% a+b #1, where%must not be double-encoded,+must not become a space, and#must not truncate the query.Every character used (
&,=,%,+,#, space) already passes the WAF inWhereOperatorsin runs #770–#781. These were the last SQL/XSS-style payloads left intest/.Testing
node --checkandeslinton the file: 0 errors. The 3 warnings are on untouched lines 238, 342 and 361.sdk-js-cda-daily-sanityrun on this branch will confirm.🤖 Generated with Claude Code