osquery-query-helper
Fail
Audited by Gen Agent Trust Hub on Oct 16, 2026
Risk Level: HIGHCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
- [COMMAND_EXECUTION]: The script
scripts/extract-table.shis vulnerable to command injection through theTABLE_NAMEargument. The script uses shell variable interpolation to insert the table name directly into anawkcommand string. - Evidence: In
scripts/extract-table.sh, the following lines construct theawkcommand:awk '/^[[:space:]]*table_name\("'"$TABLE_NAME"'"\)/ {p=1} ...'andawk '/...table_name\("'"$TABLE_NAME"'"\)/ { p=1; ... }'. - Vulnerability: Because the
$TABLE_NAMEvariable is wrapped in single quotes that are closed and reopened to accommodate the shell variable ('"$TABLE_NAME"'), a malicious input like"); system("id"); ("would break out of theawkregex and execute thesystem("id")call within theawkinterpreter, which in turn executes shell commands. - Impact: Since the agent is instructed to use this script based on user requests for specific tables, a malicious user can provide a crafted table name to achieve Remote Code Execution (RCE).
- [INDIRECT_PROMPT_INJECTION]: The skill's primary function is to ingest and process external schema files located in the
resources/directory, creating an attack surface for indirect prompt injection. - Ingestion Points: The agent reads content from
<platform>_osquery_schema.specfiles usinggrepand theextract-table.shscript (which usesawk). - Boundary Markers: There are no explicit boundary markers or instructions to the agent to ignore natural language instructions that might be embedded within the
description("...")fields or comments within the schema files. - Capability Inventory: The agent has the capability to execute shell scripts (
detect-format.sh,extract-table.sh) and use tools likegrepandlson the local filesystem. - Sanitization: No sanitization is performed on the data extracted from the schema files before it is processed by the agent or presented to the user. A malicious schema file could contain instructions that influence the agent's behavior during the 'troubleshooting' or 'improvement' phases described in
SKILL.md.
Recommendations
- AI detected serious security threats
Audit Metadata