Back to skill

Security audit

Nex Deliverables

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a legitimate offline client-deliverable tracker, but it needs review because the installer has a path-handling code-injection risk and the local client database may be created with weak permissions.

Install only from a trusted, plainly named directory, avoid paths containing quotes or unusual shell/Python metacharacters, and run setup before first CLI use. On shared machines, verify ~/.nex-deliverables is mode 700 and the SQLite database is not readable by other users. Treat exports as sensitive client data because they can create unprotected CSV or JSON copies at the chosen output path.

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 (2)

T09 · Insecure Skill Coding Practices

Warning
Location
lib/storage.py:21
Finding

Client Database May Be Created with Overly Permissive Filesystem Permissions

Content
View full analysis

Vulnerability Details

File Location: lib/storage.py:21-24
Vulnerability Type: Insecure permissions on locally stored sensitive data
Risk Level: Medium

Vulnerable Code

python
def init_db():
    """Initialize database with schema"""
    DATA_DIR.mkdir(parents=True, exist_ok=True)

    conn = _get_conn()

The CLI invokes this initialization path automatically when the database does not exist:

python
def ensure_db():
    """Ensure database exists"""
    if not DB_PATH.exists():
        init_db()

Technical Analysis

The automatic database initialization path creates the configured data directory without explicitly assigning restrictive permissions. It also opens the SQLite database without enforcing a restrictive process umask or changing the resulting database file permissions.

Consequently, permissions depend on the user's current umask. With a common umask of 022, the directory may be created with mode 0755 and the database with mode 0644. Other local users could then traverse the directory and read the database.

This differs from setup.sh, which explicitly applies mode 0700 to the data directory on non-Windows platforms. Users can bypass that protection simply by running the CLI before running the setup script because ensure_db() initializes the database automatically.

The database can contain client names, contact names, email addresses, phone numbers, contract details, retainer information, notes, deliverable descriptions, assignments, and project history.

Attack Path

  1. A user invokes the CLI without first running setup.sh.
  2. ensure_db() detects that the database does not exist and calls init_db().
  3. init_db() creates the data directory and SQLite database using permissions derived from the ambient umask.
  4. Under a permissive or standard umask, the database becomes readable by other local accounts.
  5. Another user on the same system accesses ~/.nex-deliverables/deliverables.db and ext ...[truncated 714 chars]
Remediation
View remediation

Remediation Suggestions

  • Create the application data directory with mode 0700.
  • Explicitly enforce the directory mode after creation because mkdir(mode=...) does not correct an existing directory's permissions.
  • Create the SQLite database under a restrictive process umask such as 077.
  • Explicitly set the database file to mode 0600 after creation.
  • Ensure SQLite journal, WAL, and shared-memory sidecar files receive equivalent protection.
  • Apply the same permission controls inside init_db() rather than relying on setup.sh, because database initialization can occur independently.

Example hardening approach:

python
import os

def init_db():
    DATA_DIR.mkdir(parents=True, exist_ok=True, mode=0o700)
    if os.name != "nt":
        DATA_DIR.chmod(0o700)

    old_umask = os.umask(0o077)
    try:
        conn = _get_conn()
        # Initialize schema and commit it here.
    finally:
        os.umask(old_umask)

    if os.name != "nt" and DB_PATH.exists():
        DB_PATH.chmod(0o600)

On Windows, use an appropriate access-control list that restricts the directory and database to the current user.

T09 · Insecure Skill Coding Practices

Warning
Location
setup.sh:53
Finding

Python Code Injection Through an Attacker-Controlled Installation Path

Content
View full analysis

Vulnerability Details

File Location: setup.sh:53-59
Vulnerability Type: Code injection through unsafe path interpolation
Risk Level: Medium

Vulnerable Code

bash
PYTHONPATH="$SKILL_DIR/lib" "$PYTHON" -c "
import sys; sys.path.insert(0, '$SKILL_DIR/lib')
from storage import init_db
init_db()
print('  Database ready at $DATA_DIR/deliverables.db')
"

Technical Analysis

SKILL_DIR is derived from the directory containing setup.sh and is interpolated directly into source code passed to Python through the -c option.

Although the shell variable expansion occurs inside a shell double-quoted string, its value is placed inside a Python single-quoted string:

python
sys.path.insert(0, '$SKILL_DIR/lib')

A directory name containing a single quote and valid Python syntax can terminate the intended Python string and append arbitrary statements. Quoting the variable at the shell level does not make it safe for insertion into Python source code.

For example, a crafted directory component conceptually shaped like the following can terminate the path string, execute a command, and comment out the remainder of the generated Python line:

text
payload');__import__('os').system('id');#

When the victim runs the documented installation command from such a directory, the injected Python executes with the victim's privileges. Execution occurs before later setup failures can stop the installer.

The installer also substitutes SKILL_DIR into a generated shell wrapper at setup.sh:70. That path should similarly be treated as untrusted structured data rather than replacement text, although the confirmed injection sink described here is the Python -c construction.

Attack Path

  1. An attacker distributes or relocates the project under a directory whose name contains a single quote followed by Python syntax.
  2. The victim follows the documented installation instruction and runs bash setup.sh.
  3. The script computes SKILL_DIR ...[truncated 1052 chars]
Remediation
View remediation

Remediation Suggestions

Do not interpolate filesystem paths into generated Python source. Pass the path as an environment variable or command-line argument and read it as data.

For example:

bash
SKILL_DIR="$SKILL_DIR" "$PYTHON" -c '
import os
import sys

skill_dir = os.environ["SKILL_DIR"]
sys.path.insert(0, os.path.join(skill_dir, "lib"))
from storage import init_db
init_db()
'

Additional hardening measures:

  • Avoid generating executable source code from variable content.
  • Replace the sed-based wrapper path substitution with a mechanism that safely serializes shell arguments.
  • Prefer installing a fixed Python entry point or creating a wrapper that determines its target without embedding unescaped path text.
  • Test installation from directories containing spaces, quotes, ampersands, backslashes, dollar signs, and newline characters.
  • Do not recommend or require elevated privileges for this user-local installer.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (10)

Tp4

High
Category
MCP Tool Poisoning
Confidence
89% confidence
Finding

The code substantially matches the stated purpose: it is a local SQLite-based deliverable/project tracker with clients, statuses, deadlines, overdue detection, summaries, priorities, and generated client status emails. However, there are some notable description/behavior discrepancies. The implementation includes undeclared capabilities such as export to CSV/JSON, milestone tracking, and richer client account metadata. More importantly, one declared capability is overstated: the description promises search by title, client name, deliverable type, or priority with full-text search, but the provided search function only performs SQL LIKE matching on deliverable title, description, and notes—not client name, type, or priority. Because the core purpose is aligned but several capabilities are mismatched or missing relative to the description, this should be flagged as a mismatch.

Content

No source excerpt is available for this finding.

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
95% confidence
Finding

Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Content

Scanner excerpt · setup.sh (reported line 76)May include surrounding context.

sh
# Replace placeholder with actual path
sed -i.bak "s|SKILL_DIR_PLACEHOLDER|$SKILL_DIR|g" "$BIN_DIR/nex-deliverables"
rm -f "$BIN_DIR/nex-deliverables.bak"
chmod +x "$BIN_DIR/nex-deliverables"
echo "  CLI installed to $BIN_DIR/nex-deliverables"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill advertises shell execution via setup and CLI usage, local file writes via exports and database initialization, and environment dependence, but it does not declare any explicit tool scope or allowed-tools boundary. That increases the chance an agent grants broader-than-necessary execution privileges, making accidental command execution or file modification easier if the skill is invoked unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list contains broad natural phrases like 'deadline', 'client status', 'what's due', and 'show overdue', which could match ordinary conversation and cause unintended skill activation. Because the skill can run shell-backed commands that read and write local project data, accidental invocation may expose sensitive client information or alter records without a deliberate user intent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This function stores client data including contact names, email addresses, phone numbers, contract dates, and notes in a local SQLite database. The operation persists potentially sensitive business and personal information, but the file contains no user-facing warning or disclosure about that storage behavior.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This function saves deliverable metadata, assignments, deadlines, descriptions, notes, and tags to a SQLite database. Because it writes potentially sensitive project information to persistent storage and provides no visible warning or disclosure, users may be unaware their data is being retained locally.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · setup.sh (reported line 51)May include surrounding context.

sh
echo "[2/4] Creating data directory..."
mkdir -p "$DATA_DIR"
if [ "$PLATFORM" != "windows" ]; then
    chmod 700 "$DATA_DIR"
fi
echo "  Data directory: $DATA_DIR"

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill encourages exporting client deliverable data to CSV/JSON files but does not warn about sensitive business data, destination paths, file overwrites, or the risk of creating unprotected copies. In a client-management context, exports may contain names, emails, deadlines, and work status that become easier to leak or mishandle once written to general-purpose files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This code creates the data directory and initializes a SQLite database on disk, which is a persistent file-writing operation. Although the function name and docstring describe the behavior for developers, there is no user-facing confirmation, warning, or disclosure that local files will be created.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The export command writes deliverable data to a user-specified path via write_text(), which can create or overwrite local files containing client information. Although the operation is part of an export feature, this file does not provide any explicit warning or confirmation about writing potentially sensitive client data to disk.

Content

No source excerpt is available for this finding.