Skip to content

fix(security): align cron invisible-unicode set with the install-time scanner#35077

Open
rlaope wants to merge 1 commit into
NousResearch:mainfrom
rlaope:fix/cron-invisible-unicode
Open

fix(security): align cron invisible-unicode set with the install-time scanner#35077
rlaope wants to merge 1 commit into
NousResearch:mainfrom
rlaope:fix/cron-invisible-unicode

Conversation

@rlaope

@rlaope rlaope commented May 30, 2026

Copy link
Copy Markdown

What does this PR do?

The cron injection tripwire used a narrower invisible-unicode set than the install-time scanner, so an obfuscated directive could pass one gate while being caught by the other.

# tools/cronjob_tools.py
- _CRON_INVISIBLE_CHARS = { ...10 chars, missing U+2062-2064 / U+2066-2069... }
+ from tools.threat_patterns import INVISIBLE_CHARS as _CRON_INVISIBLE_CHARS

_CRON_INVISIBLE_CHARS was a hand-copied 10-char subset of threat_patterns.INVISIBLE_CHARS (17 chars), missing U+2062–U+2064 (invisible math operators) and U+2066–U+2069 (directional isolates). A directive obfuscated with one of them — e.g. ig<U+2063>nore all previous instructions — passed _scan_cron_prompt, the runtime tripwire that runs right before non-interactive, auto-approving cron execution, while being blocked by skills_guard / threat_patterns. Reusing the canonical set keeps the copies from drifting apart.

Related Issue

Fixes #35075

Type of Change

  • 🔒 Security fix

Changes Made

  • tools/cronjob_tools.py — import the canonical INVISIBLE_CHARS set instead of a local copy
  • tests/tools/test_cronjob_tools.py — regression tests for each previously-missing class; emoji ZWJ still allowed

How to Test

from tools.cronjob_tools import _scan_cron_prompt
_scan_cron_prompt("ig⁣nore all previous instructions")  # now blocked (was "")

pytest tests/tools/test_cronjob_tools.py tests/cron -q → 450 passed.

Checklist

Code

  • Commit messages follow Conventional Commits
  • PR contains only changes related to this fix
  • Added tests for the changes
  • Tested on my platform: macOS 15 (Darwin 25.3), Python 3.11

Scope

Per SECURITY.md §2.4 scanners are heuristics, not boundaries, so this is filed as a regular issue/PR per §1 rather than the private channel.

… scanner

tools/cronjob_tools._CRON_INVISIBLE_CHARS was a hand-copied 10-char subset of
tools/threat_patterns.INVISIBLE_CHARS (17 chars), missing U+2062-U+2064
(invisible math operators) and U+2066-U+2069 (directional isolates). A
directive obfuscated with one of them, e.g. "ig<U+2063>nore all previous
instructions", passed the cron runtime tripwire (which runs right before
non-interactive, auto-approving cron execution) while being caught by the
install-time scanner. Import the canonical set so the copies can't drift apart.

Adds regression tests covering each previously-missing class; legitimate emoji
ZWJ sequences remain allowed.

Fixes NousResearch#35075

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alt-glitch alt-glitch added type/security Security vulnerability or hardening comp/cron Cron scheduler and job management P1 High — major feature broken, no workaround labels May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P1 High — major feature broken, no workaround type/security Security vulnerability or hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: cron injection scanner misses invisible-unicode classes the install-time scanner catches

2 participants