Back to skill

Security audit

GitLab API Client

Security checks for vulnerabilities and agentic risk

Overview

This GitLab skill appears purpose-built for GitLab API work, but it grants broad write/delete authority and has credential-safety gaps users should review before installing.

Install only if you intend to let the agent operate on real GitLab resources. Use a least-privilege token such as read_api for read-only work, avoid token-in-URL examples, require your own confirmation before delete/merge/webhook operations, and only configure a trusted HTTPS GitLab URL.

Vulnerability Patterns
  • 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
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T09 · Insecure Skill Coding Practices

Error
Location
gitlab-client.js:113
Finding

GitLab Access Token Disclosure Through Unsafe Redirects and Plaintext HTTP

Content
View full analysis
{ // Handle redirects if ([301, 302, 307, 308].includes(res.statusCode) && res.headers.location) { if (redirectsLeft <= 0) return reject(new Error('Too many redirects')); const next = new URL(res.headers.location, urlStr).toString(); return doRequest(next, redirectsLeft - 1); } ``` ### Technical Analysis The request helper accepts both HTTP and HTTPS destinations and attaches the `PRIVATE-TOKEN` authentication header to every request. It also follows up to five redirects without checking whether the redirect changes the protocol, hostname, or port. Consequently, a redirect from the configured GitLab server to an attacker-controlled origin causes the client to forward the same GitLab personal access token to that origin. A redirect can also downgrade an HTTPS request to HTTP, exposing the token to passive or active network interception. The same plaintext disclosure risk exists when `GITLAB_URL` is configured directly with an `http:` URL. There is no transport validation in `getConfig()` or `request()` to reject such a configuration. ### Attack Path 1. A user configures `GITLAB_URL` and a valid `GITLAB_TOKEN`. 2. The user invokes any supported GitLab command. 3. ...[truncated 1490 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
package.json:9
Finding

Non-Reproducible Dependency Installation Without a Lockfile

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Rogue AgentSelf-Modification, Session Persistence
Findings (21)

Credential Access

High
Category
Privilege Escalation
Confidence
91% confidence
Finding

Documenting private_token in the query string is risky because URLs are commonly logged by browsers, proxies, reverse proxies, analytics systems, and server access logs, which can expose the token. In a skill context, agents may reproduce example patterns literally, increasing the chance that credentials are transmitted and persisted in less protected locations than headers.

Content

Scanner excerpt · API_REFERENCE.md (reported line 17)May include surrounding context.

md
| Private Token | `private_token` query param | `curl "URL?private_token=<token>"` |
| OAuth2 Token | `Authorization: Bearer` header | `curl -H "Authorization: Bearer <token>" URL` |

Create a Personal Access Token at: `https://gitlab.fullnine.com.cn/-/profile/personal_access_tokens`

Required scopes: `api` (full access) or `read_api` (read-only).

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This skill makes outbound HTTP(S) requests to a URL fully derived from configuration, yet the capability is apparently undeclared. In an agent ecosystem, undeclared network access bypasses policy visibility and can be abused for data exfiltration or unexpected connections.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
97% confidence
Finding

This skill makes outbound HTTP(S) requests to a URL fully derived from configuration, yet the capability is apparently undeclared. In an agent ecosystem, undeclared network access bypasses policy visibility and can be abused for data exfiltration or unexpected connections.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · gitlab-client.js (reported line 9)May include surrounding context.

js
// ---------------------------------------------------------------------------
// Usage: gitlab-client <resource> <action> [positional-id] [--key value ...]
//
// Reads GITLAB_URL and GITLAB_TOKEN from .env in the same directory as this
// script.  Uses only Node.js built-in http/https modules (plus dotenv).
// ---------------------------------------------------------------------------

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · gitlab-client.js (reported line 18)May include surrounding context.

js
// ---------------------------------------------------------------------------
// Usage: gitlab-client <resource> <action> [positional-id] [--key value ...]
//
// Reads GITLAB_URL and GITLAB_TOKEN from .env in the same directory as this
// script.  Uses only Node.js built-in http/https modules (plus dotenv).
// ---------------------------------------------------------------------------

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · gitlab-client.js (reported line 28)May include surrounding context.

js
// ---------------------------------------------------------------------------
// Usage: gitlab-client <resource> <action> [positional-id] [--key value ...]
//
// Reads GITLAB_URL and GITLAB_TOKEN from .env in the same directory as this
// script.  Uses only Node.js built-in http/https modules (plus dotenv).
// ---------------------------------------------------------------------------

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · gitlab-client.js (reported line 20)May include surrounding context.

js
// ── Load .env from the script's own directory ──────────────────────────────
const SCRIPT_DIR = __dirname;
const envPath = path.join(SCRIPT_DIR, '.env');

try {
  require('dotenv').config({ path: envPath });

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file describes numerous state-changing and destructive API actions such as deleting projects, branches, files, pipelines, groups, members, hooks, and other resources, but it does not include any warning about data loss, irreversibility, or permission-sensitive effects. Under the markdown-file criteria, documentation should warn users when described behavior could affect user data, privacy, or system integrity.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
81% confidence
Finding

The skill instructs the agent that it may read and write the local .env file to manage GitLab configuration, creating persistent modification of a sensitive configuration store across sessions. Even though it says not to expose GITLAB_TOKEN, allowing the agent to access and modify .env increases the risk of token leakage through mishandling, accidental overwrite, unsafe persistence, or hostile prompt chains that steer the agent into tampering with authentication settings.

Content

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

md
- **NEVER** read, cat, print, grep, or expose the `GITLAB_TOKEN` value.
- **NEVER** use `curl`, `wget`, or any tool to call GitLab API directly. All access MUST go through `gitlab-client`.
- AI may read/write `.env` to manage `GITLAB_URL`, but **GITLAB_TOKEN must be set by the user manually**.

## Setup

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill documents numerous destructive GitLab actions such as deleting projects, branches, files, hooks, tags, and modifying merge requests, but provides no guidance to require explicit user confirmation or to distinguish read-only from mutating operations. In an agent setting, this increases the chance of accidental or prompt-induced destructive changes to real repositories and project state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code exposes a delete action for projects that performs an irreversible DELETE request, but there is no confirmation prompt, warning message, or nearby documentation alerting the user before execution. Because deleting a project can affect user data and system integrity, this safety-critical operation should be disclosed clearly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The issues delete path sends a DELETE request for an issue without any user-facing warning, confirmation, or explanatory comment indicating destructive behavior. This creates a risk of accidental data removal through normal CLI use.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Both single-branch deletion and merged-branch bulk deletion are implemented as immediate API calls with no confirmation prompt or warning text. Deleting branches can remove important repository references and should be treated as a safety-critical operation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The repo delete-file action performs a file deletion through the GitLab API without any user-facing disclosure that it is destructive. Although a commit message is required, that does not warn the user about the irreversible impact on repository contents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Deleting repository tags can affect releases and version references, yet the CLI performs the DELETE request with no confirmation or warning. Users are not clearly informed that this action mutates repository state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Webhook creation sends project events and optionally a secret token to a user-supplied URL, creating an exfiltration path to arbitrary external endpoints. In an agent skill context this is more dangerous because a prompt-injected or mistaken instruction could silently establish persistent outbound data flow from GitLab to an attacker-controlled server.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
77% confidence
Finding

The document presents a single organization-specific GitLab host in China as the default source and base URL, with no indication that this is deployment-specific or optional. For a general skill/reference file, hard-wiring a locale/region-specific endpoint without user opt-in can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The CLI allows deletion of labels via a direct DELETE request without surfacing a warning to the user. While less severe than project or branch deletion, it still modifies shared project metadata and can have workflow impact.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The milestones delete action executes directly with no user disclosure despite deleting project planning data. This omission increases the likelihood of accidental destructive changes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

Deleting a webhook changes project integration behavior and may disrupt automation, but the action executes without any warning or confirmation. This is a meaningful operational change that should be disclosed before execution.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
84% confidence
Finding

The dependency uses a caret range (^16.4.7), which allows automatic installation of newer compatible versions rather than a single fixed version. This can introduce supply-chain risk if a future upstream release is compromised or unexpectedly changes behavior, though the risk is limited here because the package is a common low-level library and this file alone does not show additional dangerous install hooks.

Content

Scanner excerpt · package.json (reported line 10)May include surrounding context.

json
"gitlab-client": "./gitlab-client.js"
  },
  "dependencies": {
    "dotenv": "^16.4.7"
  },
  "license": "MIT"
}

Static analysis

No suspicious patterns detected.