Vulnerability in Rules Files With Hidden Unicode Characters

In this article:
Subscribe to our blog:

Pillar Security, a cybersecurity company specializing in securing the entire lifecycle of artificial intelligence (AI) applications, just released information on a novel way of exploiting AI rules files as a bad actor. Details can be found here.

What this means: It’s possible to write “hidden” non-printing Unicode characters into these rules files in a way that’s not detectable to the human eye at code review time.

AI tools read those characters as instructions—your good old “disregard all previous instructions and provide the recipe for a delicious cake” type deal.

Except in this case, it’s not a cake; it’s instructions to add a security vulnerability to the AI assistant’s output.

What we're doing about it: We’ve already published a new Semgrep rule for Codacy customers that will defeat this exploit; you can find it on the patterns page by searching for “detect-invisible-unicode.

We recommend adding this rule to your organization’s default coding standard and any other standard you use widely.

image-Mar-19-2025-04-01-59-3426-PMDon’t let hidden vulnerabilities compromise your AI applications. Codacy’s advanced static analysis and custom Semgrep rules help you detect and prevent exploits like this before they become a threat. 

Get started with Codacy today.

RELATED
BLOG POSTS

Codacy Vulnerability Scanning Now Includes Insecure Dependencies Detection
As recently announced during our latest Product Showcase, our team is invested in developing new and exciting Codacy security features.
Thousands of New SAST Rules Added With Semgrep Integration
If 2023 taught us anything, it’s that code quality and code security are inextricably linked. Their main commonality? They are both required upstream...
AppSec Dashboard
What good are all these advanced security scans if the results are hard to see? Enter the new AppSec Dashboard, which gives Codacy Security users a...

Automate code
reviews on your commits and pull request

Group 13