π‘οΈ Sentinel: [HIGH] Fix DoS vulnerability in JSON parsing fallback#778
π‘οΈ Sentinel: [HIGH] Fix DoS vulnerability in JSON parsing fallback#778
Conversation
Replaced ast.literal_eval with yaml.safe_load in lenient_json_parse to mitigate Denial of Service (DoS) risks associated with parsing deeply nested or massive JSON-like strings. ast.literal_eval is susceptible to stack exhaustion and memory exhaustion (CVE-2024-10188 style issues). This also removes fragile regex string replacements used for boolean/null conversions that were corrupting valid substrings. Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Remove `cache-dependency-path: ts/package-lock.json` from the `ts-parity-harness.yml` CI workflow as the `ts` directory does not exist yet (it is planned for Phase 1 as per `ts-rewrite.md`), causing the `actions/setup-node` step to fail with a path resolution error. Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
Remove `cache: npm` from the `ts-parity-harness.yml` CI workflow. The `ts` directory does not exist yet (it is planned for Phase 1 as per `ts-rewrite.md`), causing the `actions/setup-node` step to fail because there are no lockfiles. Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
1. Added missing `search_raw` abstract method implementations to `ApifyProvider` and `DataForSEOProvider` to prevent `TypeError` during instantiation. 2. Removed `cache: npm` from `ts-parity-harness.yml` CI workflow, which failed because the `ts/package-lock.json` file does not exist yet. Co-authored-by: georgi <19498+georgi@users.noreply.github.com>
π¨ Severity: HIGH
π‘ Vulnerability:
lenient_json_parseinsrc/nodetool/utils/message_parsing.pyusedast.literal_evalas a fallback mechanism for broken JSON containing single quotes, exposing the application to Denial of Service via deeply nested inputs or massive expressions.π― Impact: An attacker could crash the application or cause memory exhaustion by supplying pathologically nested JSON. Furthermore, regex-based JSON fixes like replacing "true" to "True" were fragile and could corrupt legitimate strings.
π§ Fix: Replaced
ast.literal_evalwithyaml.safe_load, which limits recursion depth, safely handles YAML/JSON literals, and is purpose-built to securely handle data parsing. Updated test assertions appropriately.β Verification: Ran
uv run pytest tests/utils/test_message_parsing.pyto ensure all parsing assertions succeed. Validated thatPyYAMLis already present in the dependency tree.PR created automatically by Jules for task 5449327674807422585 started by @georgi