Skip to content

fix(scanner): accept two ordinary chat-template shapes - #171

Merged
lab700xdev merged 1 commit into
mainfrom
fix-chat-template-false-positives
Nov 30, 2026
Merged

lab700xdev merged 1 commit into
mainfrom
fix-chat-template-false-positives

Conversation

@lab700xdev

Copy link
Copy Markdown
Contributor

Two ordinary chat-template shapes scored CRITICAL:

  • lipsum is defined, which asks which engine is rendering. is defined / is undefined tests on lipsum, cycler and joiner are now accepted. Any other use is still reported.
  • ns.system, a field on the template's own {% set ns = namespace(...) %}. It is accepted only if nothing else can be bound to ns or namespace, the field is not called, and the template is well formed. It is limited to the name ns, because a template can bind any name in a branch that never runs.

Trade-off: a method stored in ns.system through a subscript and then reached through another variable is no longer reported. The same code with any other field name already was not.

Checked against 791 public chat templates: five change, all from CRITICAL to no findings. 400,000 generated templates rendered in Jinja2 3.1.6: none that reads os.system or uses lipsum comes back clean.

Asking whether lipsum, cycler or joiner is defined, and reading a system field on the template's own namespace, scored CRITICAL.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T05:27:33.046891Z 24bb111 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lab700xdev
lab700xdev merged commit 853765f into main Nov 30, 2026
2 checks passed
@lab700xdev
lab700xdev deleted the fix-chat-template-false-positives branch November 30, 2026 05:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant