Back to skill

Security audit

MantisBT Manager

Security checks for vulnerabilities and agentic risk

Overview

This Mantis management skill is coherent but needs Review because it can send API tokens to user-selected servers and exposes powerful account/data-changing actions without clear guardrails.

Install only if you trust the Mantis endpoints and can enforce safe operating practices: keep tokens least-privilege and instance-specific, avoid changing the base URL without also supplying the matching token, require explicit confirmation before destructive or admin actions, and do not display or log token-derived values.

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

Error
Location
SKILL.md:10
Finding

Arbitrary Base URL Override Can Expose the Fallback Mantis API Token

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 10–53 and 68–86
Vulnerability Type: Independent URL and credential resolution permits credential disclosure
Risk Level: High

Vulnerable Code Snippet

text
## 🔐 Base URL & Token Resolution

### Base URL Resolution
Base URL precedence (highest to lowest):
1. `temporary_base_url` — one-time use URL for specific operations
2. `user_base_url` — user-defined URL for the current session
3. `MANTIS_BASE_URL` — environment default URL
text
### Token Resolution
Token precedence (highest to lowest):
1. `temporary_token` — one-time use token for specific operations
2. `user_token` — user-defined token for the current session
3. `MANTIS_API_TOKEN` — environment default token
text
### Authentication Headers
**All API requests must include:**

Authorization: Bearer {{resolved_token}}
Content-Type: application/json
text
### Setting Temporary Values (One-Time Use)

**User queries:**
- "Use https://staging.mantis.com/api/rest for this request"
- "Connect to production instance for this operation"
- "Use token ABC123 just this once"

**Action:**
Set temporary_base_url = "https://staging.mantis.com/api/rest"
Set temporary_token = "ABC123"
... perform operation ...
Clear temporary_base_url
Clear temporary_token

Technical Analysis

The skill resolves the destination URL and authentication token independently. A user-provided temporary_base_url or user_base_url can replace the trusted environment URL while the token resolution can still fall back to MANTIS_API_TOKEN.

Because all API requests are required to include Authorization: Bearer {{resolved_token}}, changing only the base URL causes the environment credential to be transmitted to the newly selected destination. The documentation does not require:

  • Binding a token to its intended Mantis origin.
  • Supplying a new token whenever the origin changes.
  • Restricting destinations to an administrator-controlled all ...[truncated 2355 chars]
Remediation
View remediation

Remediation Suggestions

  1. Bind credentials to approved origins. Store each token together with its exact scheme, host, port, and permitted API path. Never send a token when the resolved destination does not match its bound origin.

  2. Disable fallback credentials after an origin change. If temporary_base_url or user_base_url differs from MANTIS_BASE_URL, require an explicitly associated token. Fail closed rather than falling back to MANTIS_API_TOKEN.

  3. Use an administrator-controlled allowlist. Permit dynamic instance switching only to preconfigured Mantis origins. Normalize and validate URLs before comparison to prevent user-info, subdomain, encoded-host, and path-confusion bypasses.

  4. Require secure transport. Accept only https:// destinations, except for an explicitly enabled local development mode. Reject URLs containing embedded credentials.

  5. Apply safe redirect handling. Disable redirects by default for authenticated requests or strip the Authorization header on every cross-origin redirect. Revalidate the final destination against the allowlist.

  6. Require confirmation for new origins. Before transmitting any credential to an origin not previously approved, display the normalized origin and credential source without revealing the token, then request explicit user authorization.

  7. Use least-privilege, instance-specific tokens. Do not reuse tokens across production, staging, and client environments. Use short expiration periods and rotate any token that may have been exposed.

  8. Add explicit skill instructions. Replace the independent precedence rules with logic equivalent to:

    text
    If resolved_base_url differs from the token's bound base URL:
        require an explicitly configured token for that exact origin;
        otherwise abort without making a request.
    
  9. Avoid credential disclosure in diagnostics. Continue masking displayed tokens and ensure request logs, error messages, and ...[truncated 50 chars]

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Memory PoisoningPersistent Context Injection, Context Window Stuffing, Memory Manipulation
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

Scanner excerpt · README.md (reported line 165)May include surrounding context.

Set user_token = client.token GET /issues?filter_id=daily_filter Collect stats Clear context → Generate consolidated report

text

Memory Manipulation

High
Category
Memory Poisoning
Confidence
80% confidence
Finding

Skill manipulates agent memory, state, or stored context. Memory corruption can alter personality, override safety rules, or cause unpredictable behavior.

Content

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

Set user_token = client.token GET /issues?filter_id=daily_filter Collect stats Clear context → Generate consolidated report

text

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The multi-instance examples encourage dynamic switching of base URLs and tokens across production, staging, and client environments without warning about SSRF-like risks, accidental data disclosure, or cross-tenant mix-ups. Because the skill supports context-aware instance and token resolution, weak validation or careless operator prompts could direct requests to attacker-controlled endpoints or leak one client's data into another environment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README documents sensitive operations such as password resets, token generation, configuration changes, impersonation, and broad CRUD actions without consistently warning about irreversible effects, authorization requirements, or audit implications. In an agent skill, documentation shapes model behavior, so omission of confirmation and least-privilege guidance increases the chance of unsafe or unintended privileged actions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill encourages handling temporary and session tokens, plus later impersonation features, but provides no guardrails about secret minimization, redaction, storage lifetime, or authorization checks. This is dangerous because agents may solicit, retain, or misuse sensitive credentials and impersonation headers in ways that expose accounts or enable unauthorized access.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly instructs the agent to display current and fallback authentication context, including masked fingerprints of both session and environment tokens. Even partial disclosure of secret-derived identifiers and the existence of fallback credentials can leak sensitive operational details, help correlate tokens across sessions, and normalize exposing environment-backed secrets to users.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documents destructive operations such as deleting issues, projects, users, attachments, notes, and tokens without requiring or even recommending confirmation, scoping checks, or dry-run behavior. In an agent setting, this increases the chance of prompt-induced or accidental irreversible actions against a live bug tracker, especially because the same skill also supports dynamic instance switching and administrative operations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The natural-language instructions throughout the README are presented exclusively in French, and the file does not indicate that language selection is optional or that the skill is intentionally restricted to French-speaking users. This can violate a language/locale policy when a skill forces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.