The vulnerability lies in the hermes-agent's Skills Guard component, specifically within the tools/skills_guard.py file. The THREAT_PATTERNS list contains regular expressions designed to detect malicious prompts. However, prior to the patch, several of these expressions were too simplistic and could be easily bypassed. For instance, the pattern r'system\s+prompt\s+override' would not match system some other words prompt override. An attacker could exploit this by crafting a malicious skill with a prompt that bypasses these weak checks, leading to a prompt injection attack. The patch addresses this by making the regular expressions more robust, for example, by changing the aforementioned pattern to r'system\s+(?:\w+\s+)*prompt\s+(?:\w+\s+)*override'. The function scan_file is directly responsible for using these patterns to scan file content, making it the core vulnerable function. The scan_skill function, which calls scan_file, is also considered a vulnerable function as it is a necessary part of the execution path for the vulnerability to be triggered.