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.sh is vulnerable to command injection through the TABLE_NAME argument. The script uses shell variable interpolation to insert the table name directly into an awk command string.
  • Evidence: In scripts/extract-table.sh, the following lines construct the awk command: awk '/^[[:space:]]*table_name\("'"$TABLE_NAME"'"\)/ {p=1} ...' and awk '/...table_name\("'"$TABLE_NAME"'"\)/ { p=1; ... }'.
  • Vulnerability: Because the $TABLE_NAME variable 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 the awk regex and execute the system("id") call within the awk interpreter, 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.spec files using grep and the extract-table.sh script (which uses awk).
  • 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 like grep and ls on 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
Risk Level
HIGH
Analyzed
Oct 16, 2026, 10:04 AM