Back to skill

Security audit

postgres-job-queue

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a Postgres job-queue coding guide, but it under-discloses state-changing database behavior and includes queue-update examples without adequate ownership or state checks.

Review this skill before installing. It is not evidence of malware, but it should be treated as a Review item because it teaches persistent database mutation patterns and some examples need hardening before production use. Require explicit approval before agents run SQL or apply generated code, and add worker ownership checks, valid state-transition checks, affected-row validation, and rollback/audit guidance.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:145
Finding

Missing Ownership and State Checks Permit Unauthorized Job-State Modification

Content
View full analysis
= max_attempts THEN 'failed' ELSE 'pending' END, last_error = $2, worker_id = NULL, claimed_at = NULL WHERE id = $1`, jobID, errMsg, ) return err } ``` ### Technical Analysis The `Complete` and `Fail` methods authorize state changes solely by the supplied job UUID. Their SQL statements do not verify that: - The job is owned by the calling worker, such as through `worker_id = q.workerID`. - The job is currently in an eligible state, such as `claimed` or `running`. - Exactly one authorized row was modified. Consequently, any worker or application component with access to these methods and knowledge of another job's UUID can change that job's status. The `Complete` method can mark an unprocessed or differently owned job as completed, while the `Fail` method can force a retry or terminal failure, inject misleading error information, and clear the legitimate worker assignment. The use of UUIDs does not constitute an authorization boundary. Job identifiers may be exposed through logs, application responses, monitoring systems, or database queries available to other workers. ### Attack Path 1. An attacker compromises a worker, gains access to an application component using the queue, or otherwise o ...[truncated 1417 chars]
Remediation
View remediation
= max_attempts THEN 'failed' ELSE 'pending' END, last_error = $3, worker_id = NULL, claimed_at = NULL WHERE id = $1 AND worker_id = $2 AND status IN ('claimed', 'running'); ``` Pass `q.workerID` as the worker parameter and verify `RowsAffected()`. Treat zero modified rows as an ownership conflict, invalid state transition, missing job, or stale claim rather than reporting success. Additional hardening measures include: 1. Centralize state transitions in stored procedures or repository methods that consistently enforce ownership and lifecycle invariants. 2. Define and enforce an explicit state-transition model, preventing transitions such as `pending` directly to `completed`. 3. Use least-privilege database roles so workers cannot issue unrestricted updates against the `jobs` table. 4. Consider a per-claim random lease token in addition to `worker_id`, and require that token for completion or failure updates. 5. Record transition audit events containing the job ID, previous state, new state, worker identity, and timestamp. 6. Add concurrency tests proving that one worker cannot complete or fail a job claimed by another worker. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (6)

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger keywords include very broad terms like 'based', 'priority', 'job', and 'queue', which are common in ordinary user conversations. Over-broad activation criteria increase the chance that an agent auto-invokes this skill in unrelated contexts, potentially surfacing database/exec-oriented instructions where they are not intended.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest advertises only a read tool, but the body of the skill clearly instructs state-changing operations such as claiming jobs, completing them, failing them, and recovering stale jobs. This mismatch weakens the agent's ability to enforce least privilege and can mislead operators into approving a skill that appears passive but is designed to mutate database state.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation contains contradictory security-relevant operational requirements: one section says no extra API key is needed, while another says the skill cannot be used without a key. Conflicting setup guidance can cause users or agents to misconfigure trust boundaries, assume capabilities are local-only when they may depend on external services, and mishandle credential requirements.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly classifies itself as usable with 'exec' capability, but it does not warn about system-impacting actions such as mutating job state, altering databases, or running commands in an operator environment. In an agent setting, this omission can cause users to underestimate operational risk and approve execution-capable behavior without informed consent.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The later documentation repeats vague trigger phrases without defining strict activation conditions, reinforcing the risk of accidental invocation. Repetition of broad keywords can bias agent routing and make the skill more likely to be selected outside its intended Postgres queue context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
75% confidence
Finding

The summary and description mix Chinese and English in a fixed way, but the document does not state that the user can choose a preferred language or locale. Under the policy, forcing or assuming a language without opt-in can be a natural-language policy issue.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.