test: LiveQuery regex timeout and context isolation are not exploitable#10226
Conversation
…condition claims Add tests proving that GHSA-qxh4-6wmx-rhg9 (LiveQuery ReDoS) and GHSA-v88r-ghm9-267f (regex race condition data leakage) are not exploitable. The ReDoS protection already exists via the default 100ms regexTimeout, and the shared vmContext cannot cause cross-contamination because safeRegexTest is synchronous.
|
🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review. Tip
Note Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect. Caution Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. |
✅ 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. |
📝 WalkthroughWalkthroughAdds 114 lines of test cases to spec/QueryTools.spec.js to validate regex timeout protections against catastrophic backtracking, verify default 100ms regexTimeout application, and ensure query isolation without context leakage or cross-contamination across evaluations. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
spec/QueryTools.spec.js (1)
1028-1037: Redundant assertion on line 1036.The assertion
expect(config.liveQuery.regexTimeout).toBeGreaterThan(0)is redundant since line 1035 already asserts the value equals 100.🔧 Suggested fix
const Config = require('../lib/Config'); const config = Config.get('test'); // Default regexTimeout is 100ms, providing ReDoS protection out-of-the-box expect(config.liveQuery.regexTimeout).toBe(100); - expect(config.liveQuery.regexTimeout).toBeGreaterThan(0); });🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@spec/QueryTools.spec.js` around lines 1028 - 1037, Remove the redundant positive-range assertion in the test "applies default regexTimeout of 100ms protecting against ReDoS (GHSA-qxh4-6wmx-rhg9)": after verifying config.liveQuery.regexTimeout equals 100 (using Config.get('test') and the local variable config), delete the extra expect(config.liveQuery.regexTimeout).toBeGreaterThan(0) assertion so the test only asserts the single exact value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@spec/QueryTools.spec.js`:
- Around line 1028-1037: Remove the redundant positive-range assertion in the
test "applies default regexTimeout of 100ms protecting against ReDoS
(GHSA-qxh4-6wmx-rhg9)": after verifying config.liveQuery.regexTimeout equals 100
(using Config.get('test') and the local variable config), delete the extra
expect(config.liveQuery.regexTimeout).toBeGreaterThan(0) assertion so the test
only asserts the single exact value.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 79699684-1d06-4a91-97f9-bd6067c02ec0
📒 Files selected for processing (1)
spec/QueryTools.spec.js
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## alpha #10226 +/- ##
=======================================
Coverage 92.60% 92.60%
=======================================
Files 192 192
Lines 16322 16322
Branches 199 199
=======================================
Hits 15115 15115
Misses 1190 1190
Partials 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
🎉 This change has been released in version 9.6.0-alpha.33 |
Issue
LiveQuery regex timeout and context isolation are not exploitable