fix: recover malformed Jinja template configs#920
fix: recover malformed Jinja template configs#920mldangelo-oai wants to merge 2 commits intomainfrom
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 5 minutes and 2 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe pull request enhances Jinja2 template extraction by treating failures as inconclusive outcomes rather than hard failures. When tokenizer configs are malformed, a raw-template fallback mechanism recovers visible templates from the original content. Extraction failures are logged with structured metadata, and results are finalized based on whether security findings are present. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 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)
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 |
Performance BenchmarksCompared
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 578794a40d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if len(raw) > _RAW_PARSE_FALLBACK_READ_BYTES: | ||
| return | ||
|
|
||
| text = raw.decode("utf-8", errors="replace") | ||
| if self._looks_like_template(text) and len(text) <= self.max_template_size: |
There was a problem hiding this comment.
Analyze bounded prefix instead of skipping malformed large configs
_extract_raw_template_fallback bails out when the file is over 256 KiB and also when decoded fallback text exceeds max_template_size (50k by default). Malformed tokenizer*.json/YAML files above these thresholds never get fallback SSTI analysis, so visible payloads are missed and scans become inconclusive (exit 2) rather than reporting security findings.
Useful? React with 👍 / 👎.
Summary
Validation
Summary by CodeRabbit
Release Notes
Bug Fixes