Back to skill

Security audit

redmine-tools

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about its Redmine and image-summary features, but its attachment download code can expose a Redmine API key to unintended endpoints.

Review before installing. Use a dedicated least-privilege Redmine API key, avoid running the image command on sensitive attachments unless the OpenAI-compatible endpoint is approved for that data, and prefer a fixed version that validates full URL origins and prevents API-key forwarding across redirects.

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
scripts/redmine.js:186
Finding

Redmine API Key May Be Disclosed Through Insufficient Origin Validation and Redirect Handling

Content
View full analysis

Vulnerability Details

File Location: scripts/redmine.js, lines 81, 143–147, and 186–210
Vulnerability Type: Authenticated request credential disclosure
Risk Level: High

The Skill sends the sensitive REDMINE_API_KEY in the custom X-Redmine-API-Key header. Attachment URLs are checked by hostname only, rather than by their complete origin, and authenticated Redmine requests use the default automatic redirect behavior.

Relevant authenticated requests include:

js
const response = await fetch(url, { headers });
js
const response = await fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify({
        issue: issuePayload,
    }),
});

The vulnerable attachment validation and request are:

js
// SSRF guard: ensure the attachment URL belongs to the same Redmine host.
// Redmine's own attachments are always served from the same origin; a
// mismatched host indicates a tampered or externally-hosted attachment URL.
if (baseUrl) {
    let attachmentHost, redmineHost;
    try {
        attachmentHost = new URL(contentUrl).hostname;
        redmineHost = new URL(baseUrl).hostname;
    } catch {
        throw new Error(`Attachment ${attachment?.id || "unknown"} has an unparseable content_url`);
    }
    if (attachmentHost !== redmineHost) {
        throw new Error(
            `Attachment ${attachment?.id || "unknown"} content_url host "${attachmentHost}" does not match Redmine host "${redmineHost}"`
        );
    }
}

// Enforce HTTPS to prevent credential leakage on redirect or misconfiguration.
validateHttpsUrl(contentUrl, `attachment ${attachment?.id || "unknown"} content_url`);

const headers = {};
if (apiKey) {
    headers["X-Redmine-API-Key"] = apiKey;
}

const response = await fetch(contentUrl, { headers });

Technical Analysis

A URL origin consists of its scheme, hostname, and effective port. The attachment chec ...[truncated 2584 chars]

Remediation
View remediation

Remediation Suggestions

  1. Validate the complete origin rather than only the hostname:

    js
    const attachmentUrl = new URL(contentUrl);
    const configuredRedmineUrl = new URL(baseUrl);
    
    if (attachmentUrl.origin !== configuredRedmineUrl.origin) {
        throw new Error("Attachment URL does not match the configured Redmine origin");
    }
    
  2. Disable automatic redirects for all requests carrying the Redmine API key:

    js
    const response = await fetch(url, {
        headers,
        redirect: "manual",
    });
    

    Apply the same policy to issue retrieval, issue updates, and attachment downloads.

  3. If redirects are operationally required, implement controlled redirect handling:

    • Limit the number of redirects.
    • Resolve each Location value safely.
    • Require HTTPS on every hop.
    • Compare every destination's complete origin with the configured Redmine origin.
    • Attach X-Redmine-API-Key only after the destination passes validation.
    • Reject redirects to URLs containing embedded credentials.
  4. Parse and normalize REDMINE_BASE_URL once, then use its validated origin to construct all Redmine API and attachment requests.

  5. Use a dedicated least-privilege Redmine API account whose permissions are limited to the projects and operations required by this Skill. Rotate the API key if exposure is suspected.

  6. Add regression tests covering alternate ports, cross-origin redirects, same-origin redirects, malformed URLs, embedded URL credentials, and HTTPS-to-HTTP redirects.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description understates the real behavior: the skill not only fetches issue data but can update issue status/notes and send Redmine image attachments to a third-party AI endpoint. This mismatch can mislead operators into authorizing the skill under a narrower trust model, causing unintended modification of tickets and external disclosure of potentially sensitive attachment contents.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/redmine.js get --id <issueId>

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill uses sensitive capabilities (environment secrets and outbound network access) but does not declare an explicit tool scope such as permissions or allowed-tools. That weakens policy enforcement and reviewability, making it easier for a consumer to invoke the skill without understanding that it can read API keys and transmit data to remote services.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
82% confidence
Finding

The image command transmits downloaded Redmine image attachments, along with issue context, to an external OpenAI-compatible API. Even if user-configured, this is a real data exfiltration path because issue attachments may contain confidential screenshots, customer data, credentials, or internal system details.

Content

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

bash
export REDMINE_BASE_URL=https://redmine.example.com
export REDMINE_API_KEY=xxxx
export OPENAI_API_URL=https://api.openai.com/v1
export OPENAI_API_KEY=xxxx
export OPENAI_MODEL=gpt-4.1-mini
export OPENAI_IMAGE_SUMMARY_PROMPT="Summarize what this image shows, explain its likely relevance to the issue, and keep the answer concise."

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The image summarization flow downloads Redmine attachments, converts them to data URLs, and sends the image contents plus issue metadata to an external OpenAI-compatible API. This creates a real data disclosure risk because attachment contents may contain sensitive screenshots, documents, or internal issue context, and the skill description/manifest does not clearly disclose this cross-system transfer.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code loads OPENAI_API_URL, OPENAI_API_KEY, OPENAI_MODEL, and a prompt from the environment and uses them to call an external AI endpoint, expanding the tool's trust boundary beyond Redmine. In a tool presented as Redmine attachment management from CLI, this is security-relevant because it can exfiltrate internal attachment data and issue context to a third-party service without that purpose being clearly justified or disclosed.

Content

No source excerpt is available for this finding.