Back to skill

Security audit

Mistral Codestral

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward local Mistral/Codestral setup guide, with the main caution being an unpinned Python package install.

Install in a virtual environment, avoid running the setup as root/admin, and review or pin the `ollama-herd` package version if you need reproducible installs. Treat prompts, generated files, and uploaded audio as data provided to your local fleet service.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:31
Finding

Unpinned Third-Party Package Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 31
Vulnerability Type: Unpinned third-party dependency installation
Risk Level: Medium

bash
pip install ollama-herd    # install Mistral fleet router

Technical Analysis

The setup instructions install ollama-herd from the package index configured for pip without specifying an exact version or validating an artifact hash. Consequently, the package and its transitive dependencies are mutable and cannot be conclusively tied to a previously audited release.

Package installation may execute package-controlled build or installation logic. The instructions then direct the user to run the installed herd and herd-node executables, providing another direct execution path. A compromised future release, compromised transitive dependency, malicious package-index configuration, or package registry compromise could therefore introduce attacker-controlled code.

No evidence establishes that the current ollama-herd package is malicious. The finding concerns the unsafe and non-reproducible dependency acquisition method documented by the Skill.

Attack Path

  1. An attacker compromises a future ollama-herd release, one of its transitive dependencies, or a package source trusted by the user's pip configuration.
  2. The user follows the Skill's setup instructions and runs pip install ollama-herd.
  3. pip resolves and installs the attacker-controlled package or dependency because no approved version or artifact hash is enforced.
  4. Malicious code may execute during package building or installation, depending on the distribution mechanism.
  5. The user subsequently runs herd or herd-node, executing the installed attacker-controlled code.
  6. The payload operates with the permissions of the account that performed the installation or launched the commands.

Impact Assessment

Successful exploitation could permit arbitrary code execution with t ...[truncated 725 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin ollama-herd to a specific, reviewed version rather than relying on the latest available release.
  • Provide a locked dependency set covering all transitive dependencies.
  • Publish and verify cryptographic hashes for every downloaded artifact, using a hash-enforcing installation workflow such as pip install --require-hashes -r requirements.txt.
  • Explicitly identify the trusted package index or verified upstream distribution source.
  • Recommend installation inside a dedicated virtual environment or similarly isolated environment.
  • Advise users not to install or run the package with administrator or root privileges.
  • Establish a controlled update process in which new versions and dependency changes are reviewed before updating the documented pins and hashes.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (6)

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 98)May include surrounding context.

bash
# See which Mistral models are loaded
curl -s http://localhost:11435/api/ps | python3 -m json.tool

# Mistral fleet overview
curl -s http://localhost:11435/fleet/status | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 101)May include surrounding context.

md
curl -s http://localhost:11435/api/ps | python3 -m json.tool

# Mistral fleet overview
curl -s http://localhost:11435/fleet/status | python3 -m json.tool

# Mistral model performance stats
curl -s http://localhost:11435/dashboard/api/models | python3 -m json.tool

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

Scanner excerpt · SKILL.md (reported line 104)May include surrounding context.

curl -s http://localhost:11435/fleet/status | python3 -m json.tool

Mistral model performance stats

curl -s http://localhost:11435/dashboard/api/models | python3 -m json.tool

text

Example Mistral fleet response:

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 51)May include surrounding context.

print(codestral_response.choices[0].message.content)

text

### Codestral via curl

```bash
# Codestral code generation on local Mistral fleet

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 125)May include surrounding context.

Image generation

bash
curl http://localhost:11435/api/generate-image \
  -d '{"model": "z-image-turbo", "prompt": "Mistral AI logo reimagined as abstract art", "width": 512, "height": 512}'

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The description includes English, Chinese, French, and Spanish text in a single skill summary. Under the policy for natural-language violations, forcing or assuming language presentation without user opt-in can be a locale-policy issue when no language choice or justification is provided.

Content

No source excerpt is available for this finding.