fix: minor security hardening - #416
Conversation
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe JSON linter now resolves input paths and rejects targets outside the current working directory before parsing. ChangesSafe path validation
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
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.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tools/specification_parser/lint_json_output.py`:
- Around line 9-11: Update the path validation flow around base and target to
use realpath() for both values before commonpath() containment checking, reject
targets whose resolved common path differs from the resolved base, and open the
resolved target rather than the original input path.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 128aa5c5-e605-41c2-986c-fe2642f79bbf
📒 Files selected for processing (1)
tools/specification_parser/lint_json_output.py
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Validate the constructed path in lint_json_output.py to prevent path traversal.