Back to skill

Security audit

Zotero Cli

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to support a real Zotero command-line workflow, but its install, update, and backup helpers include unsafe package-installation paths and weak handling of Zotero API-key backups.

Use the skill only if you are comfortable managing local Python tooling and Zotero API credentials. Prefer the pipx/PyPI install path, avoid curl | bash, git:// master installs, sudo pip, and --break-system-packages, and review any cron, PATH, alias, backup, or update script before running it. If you use backups, ensure the Zotero config and backup directory are readable only by your user account and revoke/regenerate the Zotero API key if it may have been exposed.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (4)

T03 · Remote Payload Retrieval and Execution

Error
Location
INSTALL.md:479
Finding

Unverified Remote Installer Is Piped Directly into Bash

Content
View full analysis
Remediation
View remediation
pyenv-installer.sh" | sha256sum --check - less pyenv-installer.sh bash pyenv-installer.sh ``` The URL and checksum must come from a trusted, version-specific publisher source. ]]>

T08 · Insecure Dependencies

Error
Location
INSTALL.md:233
Finding

Mutable Master Branch Is Installed over an Unauthenticated Git Transport

Content
View full analysis
Remediation
View remediation
" ``` A signed, hash-verified release package is preferable to a VCS installation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/backup_restore.sh:52
Finding

Zotero API-Key Backups Do Not Enforce Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/update_check.sh:218
Finding

Update Logic Uses an Inconsistent pip Executable and Reverses Installation Scope

Content
View full analysis
/dev/null; then zotcli_path=$(which zotcli) if [[ "$zotcli_path" == *".local/bin"* ]]; then echo "Running: pip install --upgrade zotero-cli" pip install --upgrade zotero-cli else echo "Running: pip install --upgrade --user zotero-cli" pip install --upgrade --user zotero-cli fi if [ $? -eq 0 ]; then print_success "Update successful!" new_version=$(get_current_version) echo "New version: $new_version" else print_error "Update failed" return 1 fi ``` ### Technical Analysis The script first verifies that `pip3` exists but subsequently invokes `pip`. Those names can resolve to different Python installations or, in a manipulated environment, different executables. The installation-scope logic is also reversed: - A `zotcli` executable under `.local/bin`, which indicates a user installation, is updated without `--user`. - A `zotcli` executable outside `.local/bin` is updated using `--user`, potentially creating a separate user-level package that shadows the original installation. Consequently, the update can modify an unintended Python environment, install an unexpected second copy, or execute a different `pip` program selected through `PATH`. This is particularly sensitive because package installation executes third-party build and installation code. ### Attack Path 1. The user runs `update_check.sh update`. 2. The script detects `pip3`, but does not bind later execution to that exact interpreter. 3. A different executable named `pip` appea ...[truncated 1220 chars]
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
Findings (103)

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · INSTALL.md (reported line 161)May include surrounding context.

otero-cli

bash
zotcli configure

Follow the prompts to enter your Zotero userID and generate an API key.

Method 2: pip Installation (Generic)

For systems without PEP 668 restrictions or when using virtual environments.

Step 1: Install zotero-cli

Using user installation (recommended):

bash
pip install --user zotero-cli

Ensure ~/.local/bin is in your PATH:

bash
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

Using virtual environment (best practice):

bash
python3 -m venv ~/.venvs/zotero-cli
source ~/.venvs/zotero-cli/bin/activate
pip install zotero-cli

# To use zotero-cli later
source ~/.venvs/zotero-cli/bin/activate
zotcli configure

System-wide installation (not recommended on PEP 668 systems):

bash
# This will fail on PEP 668-compliant systems
sudo pip install zotero-cli

# To force install (not recommended, potential for system conflicts)
sudo python3 -m pip install --break-system-packages zotero-

External Script Fetching

High
Category
Supply Chain
Confidence
99% confidence
Finding

The instruction curl https://pyenv.run | bash fetches a remote script and immediately executes it in the shell without inspection or integrity verification. This creates a direct supply-chain and remote code execution risk if the remote content, transport, or DNS is compromised.

Content

Scanner excerpt · INSTALL.md (reported line 481)May include surrounding context.

  1. Use pyenv (advanced):
bash
# Install pyenv
curl https://pyenv.run | bash

# Install Python 3.11
pyenv install 3.11

Chaining Abuse

High
Category
Tool Misuse
Confidence
99% confidence
Finding

Piping curl output directly to bash combines network retrieval and execution in a single step, eliminating opportunities for inspection and making compromise of the upstream source immediately exploitable. In installation documentation this is especially dangerous because users often paste such one-liners verbatim.

Content

Scanner excerpt · INSTALL.md (reported line 481)May include surrounding context.

  1. Use pyenv (advanced):
bash
# Install pyenv
curl https://pyenv.run | bash

# Install Python 3.11
pyenv install 3.11

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

This exact destructive target, rm -rf ~/.config/zotcli, is a true risky command because it forcefully removes user-specific application data. The context is legitimate uninstallation, but the lack of a strong warning keeps it security-relevant from a safe-docs perspective.

Content

Scanner excerpt · INSTALL.md (reported line 612)May include surrounding context.

bash
# Remove configuration directory
rm -rf ~/.config/zotcli

# Remove virtual environment (if used)
rm -rf ~/.venvs/zotero-cli

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
94% confidence
Finding

This exact destructive target, rm -rf ~/.config/zotcli, is a true risky command because it forcefully removes user-specific application data. The context is legitimate uninstallation, but the lack of a strong warning keeps it security-relevant from a safe-docs perspective.

Content

Scanner excerpt · INSTALL.md (reported line 612)May include surrounding context.

bash
# Remove configuration directory
rm -rf ~/.config/zotcli

# Remove virtual environment (if used)
rm -rf ~/.venvs/zotero-cli

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

This command force-deletes the application's virtual environment, which is destructive though not obviously malicious. Copy-paste execution errors around rm -rf make such documentation inherently risky without guardrails.

Content

Scanner excerpt · INSTALL.md (reported line 615)May include surrounding context.

md
rm -rf ~/.config/zotcli

# Remove virtual environment (if used)
rm -rf ~/.venvs/zotero-cli

# Remove cloned repository (if installed from source)
rm -rf ~/zotero-cli

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
93% confidence
Finding

This command force-deletes the application's virtual environment, which is destructive though not obviously malicious. Copy-paste execution errors around rm -rf make such documentation inherently risky without guardrails.

Content

Scanner excerpt · INSTALL.md (reported line 615)May include surrounding context.

md
rm -rf ~/.config/zotcli

# Remove virtual environment (if used)
rm -rf ~/.venvs/zotero-cli

# Remove cloned repository (if installed from source)
rm -rf ~/zotero-cli

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

This repository deletion command is potentially harmful because it can erase local work and any files placed in that directory. Its danger comes from forced recursive deletion rather than malicious intent.

Content

Scanner excerpt · INSTALL.md (reported line 618)May include surrounding context.

rm -rf ~/.venvs/zotero-cli

Remove cloned repository (if installed from source)

rm -rf ~/zotero-cli

text

### Remove PATH Entries

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
92% confidence
Finding

This repository deletion command is potentially harmful because it can erase local work and any files placed in that directory. Its danger comes from forced recursive deletion rather than malicious intent.

Content

Scanner excerpt · INSTALL.md (reported line 618)May include surrounding context.

rm -rf ~/.venvs/zotero-cli

Remove cloned repository (if installed from source)

rm -rf ~/zotero-cli

text

### Remove PATH Entries

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · QUICKSTART.md (reported line 14)May include surrounding context.

Option A: pipx (Recommended)

bash
# Debian/Ubuntu
sudo apt update && sudo apt install pipx -y

# Arch Linux
sudo pacman -S pipx

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/setup_and_check.sh (reported line 188)May include surrounding context.

sh
#### Option A: pipx (Recommended)
```bash
# Debian/Ubuntu
sudo apt update && sudo apt install pipx -y

# Arch Linux
sudo pacman -S pipx

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The skill description frames the tool as a Zotero library interface, but the documented workflow also includes system package installation via apt and pip/pipx, remote version checks against PyPI/GitHub, and opening release pages. That broader behavior materially increases risk because it can lead to privileged system changes, network access, and software supply-chain exposure outside the expected Zotero task scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill description frames the tool as a Zotero library interface, but the documented workflow also includes system package installation via apt and pip/pipx, remote version checks against PyPI/GitHub, and opening release pages. That broader behavior materially increases risk because it can lead to privileged system changes, network access, and software supply-chain exposure outside the expected Zotero task scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill description frames the tool as a Zotero library interface, but the documented workflow also includes system package installation via apt and pip/pipx, remote version checks against PyPI/GitHub, and opening release pages. That broader behavior materially increases risk because it can lead to privileged system changes, network access, and software supply-chain exposure outside the expected Zotero task scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill description frames the tool as a Zotero library interface, but the documented workflow also includes system package installation via apt and pip/pipx, remote version checks against PyPI/GitHub, and opening release pages. That broader behavior materially increases risk because it can lead to privileged system changes, network access, and software supply-chain exposure outside the expected Zotero task scope.

Content

No source excerpt is available for this finding.

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · scripts/README.md (reported line 461)May include surrounding context.

h_process.sh'

Setup alias

alias zotsetup='~/zotero-cli/scripts/setup_and_check.sh'

Backup alias

alias zotbackup='~/zotero-cli/scripts/backup_restore.sh backup'

Update alias

alias zotupdate='~/zotero-cli/scripts/update_check.sh update'

text

### 2. Make Scripts Executable

```bash
chmod +x *.sh *.py

3. Add Scripts to PATH

For easier access, add scripts directory to PATH:

bash
echo 'export PATH="$HOME/zotero-cli/scripts:$PATH"' >> ~/.bashrc
source ~/.bashrc

Then use without full path:

bash
setup_and_check.sh
backup_restore.sh backup

4. Integration with Cron

Automate regular tasks:

cron
# Weekly backup
0 9 * * 0 /path/to/backup_restore.sh backup

# Weekly update check
0 10 * * 0 /path/to/update_check.sh check

# Monthly cleanup
0 0 1 * * /path/to/backup_restore.sh clean

5. Create Research Templates

Create reusable template files:

bash
# Create a template query file
cat > research_template.txt << 'EOF'
# Research queries template
#

YARA rule 'backdoor_persistence': Backdoor persistence with malicious payloads (shell commands, SSH key injection, hidden root users) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · scripts/setup_and_check.sh (reported line 218)May include surrounding context.

sh
..."
            pipx install zotero-cli
            ;;
        2)
            echo ""
            echo "Installing zotero-cli via pip --user..."
            pip3 install --user zotero-cli
            
            # Add to PATH if not already
            if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then
                echo ""
                echo "Adding ~/.local/bin to PATH..."
                echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
                export PATH="$HOME/.local/bin:$PATH"
            fi
            ;;
        3)
            echo ""
            echo "Manual installation instructions:"
            echo ""
            echo "1. Using pipx:"
            echo "   pipx install zotero-cli"
            echo ""
            echo "2. Using pip with user installation:"
            echo "   pip install --user zotero-cli"
            echo ""
            echo "3. Or, install from GitHub for latest version:"
            echo "   pip install git+git://github.com/jbaiter/

Chaining Abuse

High
Category
Tool Misuse
Confidence
88% confidence
Finding

The chained command sudo apt update && sudo apt install pipx -y combines repository refresh and package installation in one privileged operation. This reduces user visibility and review points, so if the flow is triggered unexpectedly or modified later, it can enable rapid, opaque system changes under elevated privileges.

Content

Scanner excerpt · scripts/update_check.sh (reported line 313)May include surrounding context.

sh
print_warning "pipx not found, installing..."
                
                if check_command apt; then
                    sudo apt update && sudo apt install pipx -y
                    pipx ensurepath
                    export PATH="$HOME/.local/bin:$PATH"
                else

Session Persistence

Medium
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · EXAMPLES.md (reported line 388)May include surrounding context.

chmod +x weekly_search.sh

Add to crontab for automated weekly execution

crontab -e

Add: 0 9 * * 1 /path/to/weekly_search.sh

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · EXAMPLES.md (reported line 395)May include surrounding context.

Example 15: Research Dashboard

bash
# Create a simple research dashboard
cat > research_dashboard.sh << 'EOF'
#!/bin/bash

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The natural-language instructions list English language as an inclusion criterion, which imposes a language restriction in the workflow. Under SQP-3, language or locale constraints should either be optional, user-selected, or clearly justified; this example presents the restriction as a default criterion without that context.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
96% confidence
Finding

The guide suggests sudo pip install pipx as an option. Running pip with root privileges installs Python code from package indexes into privileged locations and is a well-known unsafe practice that can lead to system compromise if a package or dependency is malicious or tampered with.

Content

Scanner excerpt · INSTALL.md (reported line 113)May include surrounding context.

Using pip (any system):

bash
# Using system pip (if allowed)
sudo pip install pipx
# OR using user pip
pip install --user pipx
pipx ensurepath

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
98% confidence
Finding

The command sudo pip install zotero-cli instructs users to install the package and all dependencies with root privileges. This expands the blast radius of any malicious or compromised dependency and can overwrite system-managed Python files.

Content

Scanner excerpt · INSTALL.md (reported line 179)May include surrounding context.

System-wide installation (not recommended on PEP 668 systems):

bash
# This will fail on PEP 668-compliant systems
sudo pip install zotero-cli

# To force install (not recommended, potential for system conflicts)
sudo python3 -m pip install --break-system-packages zotero-cli

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
99% confidence
Finding

sudo python3 -m pip install --break-system-packages zotero-cli explicitly bypasses OS protections and performs a privileged install into system Python. This can destabilize the host and magnify the impact of a malicious dependency or typosquatted package.

Content

Scanner excerpt · INSTALL.md (reported line 182)May include surrounding context.

sudo pip install zotero-cli

To force install (not recommended, potential for system conflicts)

sudo python3 -m pip install --break-system-packages zotero-cli

text

**⚠️ Warning:** Using `--break-system-packages` is dangerous and can damage your system's Python installation. Use pipx or virtual environments instead.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · INSTALL.md (reported line 210)May include surrounding context.

cd zotero-cli

text

#### Step 2: Create a Virtual Environment

```bash
python3 -m venv venv

Static analysis

No suspicious patterns detected.