Back to skill

Security audit

5GC Automation

Security checks for vulnerabilities and agentic risk

Overview

This skill automates sensitive 5GC console changes but ships shared credentials, disables TLS checks, caches sessions, and performs policy mutations without strong safeguards.

Review before installing. Only run this in an isolated lab or explicitly authorized 5GC management environment, rotate the exposed credentials, avoid shared accounts, pin dependencies, require valid TLS certificates, disable or protect session caching, and add confirmation or dry-run controls before any policy replacement or bulk edit.

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 (6)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/5gc.js:171
Finding
Shell Command Injection Through Forwarded CLI Arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/5gc.js:171-183` **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```js // Remove entity and action before passing arguments to the child script const childArgv = normalizeChildArgs(entity, action, argv.slice(2)); console.log(`\n▶ 5GC ${entity.toUpperCase()} ${action}`); console.log(' → node ' + scriptFile + ' ' + childArgv.join(' ') + '\n'); // Invoke the child script while preserving CLI argument isolation const child = spawn('node', [scriptPath, ...childArgv], { stdio: 'inherit', shell: true, cwd: SCRIPTS_DIR, }); child.on('exit', (code) => process.exit(code || 0)); child.on('error', (err) => { console.error('Launch failed:', err.message); process.exit(1); }); ``` ### Technical Analysis The dispatcher forwards user-controlled CLI option values to `child_process.spawn()` while enabling `shell: true`. Enabling a shell is unnecessary because Node.js can execute the selected JavaScript file directly. With shell execution enabled, argument values containing shell metacharacters may be interpreted by the platform shell rather than remaining opaque arguments. The entity and action are allowlisted, and the script path comes from a fixed map, but arbitrary option values are preserved by `normalizeChildArgs()` without a comprehensive character or type allowlist. ### Attack Path 1. An attacker obtains the ability to invoke the Skill or influence its CLI parameters. 2. The attacker places shell syntax in a forwarded option value, such as a project name or entity name. 3. `normalizeChildArgs()` preserves the malicious value in `childArgv`. 4. `spawn()` invokes the command through a shell because `shell: true` is configured. 5. The shell interprets the injected syntax and executes an additional local command. 6. The injected command runs with the same operating-system privileges as the Agent or user running the Skill. ### Impact Assessment Successful expl ...[truncated 322 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove `shell: true` and execute Node.js directly: ```js const child = spawn(process.execPath, [scriptPath, ...childArgv], { stdio: 'inherit', shell: false, cwd: SCRIPTS_DIR, }); ``` - Validate every supported option using strict schemas. - Apply length limits and type validation to names, IDs, IP addresses, ports, counts, and policy values. - Reject control characters and unexpected metacharacters. - Do not construct shell command strings from user-controlled data. - Add regression tests using shell metacharacters to verify that arguments are passed literally. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/amf-add-skill.js:19
Finding
Hardcoded Shared Administrative Credentials<![CDATA[ ## Vulnerability Details **File Location**: `scripts/amf-add-skill.js:19-22` **Additional Locations**: `SKILL.md:64-65`, `scripts/default-rule-add-skill.js:85-89`, `scripts/nrf-add-skill.js:36-38`, `scripts/pcc-add-skill.js:68-71`, `scripts/pcf-add-skill.js:36-38`, `scripts/qos-add-skill.js:60-63`, `scripts/smpolicy-ue-add-skill.js:71-74`, `scripts/smpolicy_add_pcc.js:45-48`, `scripts/tc-add-skill.js:51-55` **Vulnerability Type**: Hardcoded credentials and secret disclosure **Risk Level**: High ### Vulnerable Code ```js credentials: { email: 'dotouch@dotouch.com.cn', password: 'dotouch' }, ``` Equivalent credential literals are embedded in the login routines of the other listed scripts, and the credentials are also disclosed in the Skill documentation. ### Technical Analysis The package distributes a reusable email address and plaintext password for the 5GC management console. Source code and documentation are not suitable secret-storage mechanisms: repository readers, package recipients, build systems, logs, backups, and scanners can all obtain the credentials. The scripts use these credentials to access functionality that creates and modifies 5GC network entities and policies. Consequently, the exposed account appears to possess meaningful configuration privileges. ### Attack Path 1. An attacker obtains a copy of the Skill package, repository, documentation, build artifact, or associated logs. 2. The attacker extracts the hardcoded email address and password. 3. The attacker identifies or gains network access to a compatible 5GC console. 4. The attacker authenticates using the shared account. 5. The attacker performs any operation permitted to that account, including modification of network functions or policy configuration. ### Impact Assessment The exposed credentials may permit unauthorized access to the 5GC management console. Depending on account privileges and network reachability, an attacker could create or alter AMF, PCF, N ...[truncated 173 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the password and account name from all source files and documentation. - Immediately rotate the exposed password and invalidate existing sessions. - Use individual, least-privilege service accounts rather than a shared administrative account. - Retrieve secrets from an approved secret manager or request them interactively. - If environment variables are supported, ensure they are supplied by a protected execution environment and are never logged. - Add secret scanning to source-control and release pipelines. - Restrict the console to trusted management networks and enforce multifactor authentication where available. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/default-rule-add-skill.js:695
Finding
TLS Server Authentication Is Systematically Disabled<![CDATA[ ## Vulnerability Details **File Location**: `scripts/default-rule-add-skill.js:695-696` **Additional Locations**: `scripts/amf-add-skill.js:50,146,161`, `scripts/nrf-add-skill.js:108-109`, `scripts/pcf-add-skill.js:108-109`, `scripts/pcc-add-skill.js:68,138-139`, `scripts/qos-add-skill.js:60,117-118`, `scripts/smpolicy-ue-add-skill.js:71,151-152`, `scripts/smpolicy_add_pcc.js:45,78-79`, `scripts/tc-add-skill.js:51,88-89` **Vulnerability Type**: Improper certificate validation **Risk Level**: High ### Vulnerable Code ```js const browser = await chromium.launch({ headless: !opts.headed, args: [ '--no-sandbox', '--ignore-certificate-errors', '--disable-dev-shm-usage', '--no-proxy-server', '--proxy-server=direct://', '--proxy-bypass-list=*' ] }); const ctx = await browser.newContext({ ignoreHTTPSErrors: true, viewport: { width: 1920, height: 1080 } }); ``` ### Technical Analysis The scripts disable certificate validation at both the Chromium process level and the Playwright browser-context level. This defeats the authentication property of HTTPS: encryption may still occur, but the client cannot reliably establish that it is communicating with the intended 5GC console. This is especially dangerous because the browser transmits console credentials, authenticated cookies, CSRF tokens, and privileged 5GC configuration. The use of a private IP address or self-signed certificate does not justify accepting every invalid certificate. ### Attack Path 1. An attacker gains a network position between the Skill runner and the 5GC console, or manipulates routing, DNS, ARP, or gateway behavior. 2. The attacker presents a forged or attacker-controlled TLS certificate. 3. Chromium accepts the certificate because certificate errors are explicitly ignored. 4. The Skill submits the hardcoded credentials or cached authentication cookies to the impersonated endpoint. 5. The attacker captures the credentials or session and may proxy ...[truncated 442 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove `--ignore-certificate-errors`. - Remove `ignoreHTTPSErrors: true` from browser contexts and navigation logic. - Install the internal certificate authority in the operating system or browser trust store. - Issue a certificate whose subject alternative names match the management-console hostname. - Prefer a stable hostname over a raw IP address where certificate validation requires it. - Consider certificate or public-key pinning for tightly controlled management environments. - Fail closed on certificate errors and provide clear certificate-deployment instructions instead of bypassing validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/amf-add-skill.js:33
Finding
Authentication Sessions Stored as Plaintext Files Without Explicit Access Restrictions<![CDATA[ ## Vulnerability Details **File Location**: `scripts/amf-add-skill.js:33-50` **Additional Locations**: `scripts/nrf-add-skill.js:14-26,42-43`, `scripts/pcf-add-skill.js:14-26,42-43` **Vulnerability Type**: Insecure storage of authentication tokens **Risk Level**: Medium ### Vulnerable Code ```js class SessionManager { constructor() { this.sessionPath = path.join(CONFIG.sessionDir, CONFIG.getSessionFile()); } async saveSession(context) { try { const storageState = await context.storageState(); fs.writeFileSync( this.sessionPath, JSON.stringify({ storageState }, null, 2) ); return true; } catch { return false; } } async loadSession(browser) { try { if (!fs.existsSync(this.sessionPath)) return null; const { storageState } = JSON.parse( fs.readFileSync(this.sessionPath, 'utf8') ); return await browser.newContext({ storageState, ignoreHTTPSErrors: true, viewport: { width: 1920, height: 1080 } }); } catch { return null; } } } ``` ### Technical Analysis Playwright storage state can contain authenticated cookies and browser storage values that function as bearer credentials. The code serializes this state into plaintext JSON under `scripts/.sessions/`. No explicit restrictive file mode, encryption, secure operating-system credential store, expiry enforcement, or deletion procedure is shown. The effective permissions therefore depend on the host's default umask and directory permissions. Session files may also be accidentally copied into archives, backups, or source-control commits. ### Attack Path 1. The Skill authenticates to the console and saves Playwright storage state. 2. Another local user, compromised process, backup reader, or artifact collector obtains access to `scripts/.sessions/`. 3. The attacker copies the stored cookies or complete browser state. 4. The attacker imports the state in ...[truncated 415 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Prefer ephemeral browser sessions and avoid persistent authentication state where possible. - If caching is required, use an operating-system credential store or another protected secret-storage facility. - Create the session directory with mode `0700` and session files with mode `0600`. - Store only the minimum required cookies rather than the complete browser state. - Validate expiration and origin before loading cached sessions. - Delete cached state on logout, authentication failure, account rotation, and a defined maximum lifetime. - Add `.sessions/` to source-control and packaging exclusions. - Never print cookie values or full storage state to logs. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/default-rule-add-skill.js:548
Finding
Hardcoded Policy Record ID Used When Secure Lookup Fails<![CDATA[ ## Vulnerability Details **File Location**: `scripts/default-rule-add-skill.js:548-553` **Vulnerability Type**: Fail-open configuration and unsafe object reference **Risk Level**: Medium ### Vulnerable Code ```js if (!smpId) { console.error('The sm_policy_default ID was not found'); console.log('Attempting to use default ID 9771'); return '9771'; } ``` The original source uses equivalent localized log messages; the security-relevant behavior is the unconditional fallback to record ID `9771`. ### Technical Analysis When the script cannot locate the intended `sm_policy_default` record, it does not terminate safely. Instead, it returns a hardcoded database-style identifier. Record identifiers are deployment-specific and are not proof of record identity, project ownership, or policy type. On another console or after records are recreated, ID `9771` may refer to a different object or may not exist. Returning the fallback also obscures the lookup failure and can make later workflow logic appear successful. ### Attack Path 1. The expected policy lookup fails because of UI changes, timing, permissions, missing data, or deliberate manipulation of the page. 2. The script substitutes the value `9771`. 3. Subsequent workflow logic treats the fallback as the intended policy identifier or proceeds with misleading success state. 4. If that identifier exists and refers to another policy, the wrong policy may be associated with a PCF configuration. 5. Verification may be incomplete or fail only after partial configuration changes have already occurred. ### Impact Assessment This can corrupt configuration integrity by binding an unintended policy or leaving the system in a partially modified state. The impact is limited to objects the authenticated console account can modify, but that scope may include production PCF and SMPolicy configuration. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Remove the hardcoded fallback and fail closed when the policy cannot be resolved. - Resolve records using a verified immutable identifier returned by the server. - Confirm the record's name, type, selected project, and ownership before updating the PCF. - Make every workflow step return an explicit success or failure result, and stop on failure. - Add post-update verification that queries the server and confirms the exact resulting association. - Where feasible, implement rollback for QoS, TC, and PCC objects created before a later step fails. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:63
Finding
Unpinned Dependency Installation and Runtime Tool Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:63` **Vulnerability Type**: Unpinned third-party dependency and non-reproducible installation **Risk Level**: Medium ### Vulnerable Code ```bash npm i playwright && npx playwright install chromium ``` ### Technical Analysis The installation instructions request the latest package matching the unpinned `playwright` name and then execute its command-line tooling through `npx`. No package manifest or lockfile is present in the supplied project structure. The package name itself is legitimate, and the audit found no evidence of dependency confusion or typosquatting. However, the effective dependency code can change over time, making installation non-reproducible and increasing exposure to a compromised or malicious future release. ### Attack Path 1. A user follows the documented installation command. 2. The package manager resolves the current package version rather than a reviewed, fixed version. 3. Package installation behavior and `npx` tooling execute in the user's environment. 4. If the registry, account, package release, or dependency chain is compromised, attacker-controlled package code can execute with the user's privileges. ### Impact Assessment A compromised dependency or dependency release could execute arbitrary code during installation or tooling execution. The resulting scope equals the privileges of the user performing installation and can include access to project files, local credentials, network resources, and cached 5GC sessions. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Add a `package.json` with an explicitly reviewed Playwright version. - Commit a package-lock file with integrity hashes. - Use `npm ci` rather than an unconstrained `npm install`. - Configure a trusted registry and enforce lockfile integrity in CI. - Pin and document the expected Chromium revision. - Periodically review dependency advisories and update through a controlled testing process. - Avoid executing unreviewed package tooling with elevated privileges. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (54)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The documentation advertises broad batch add/edit and one-click PCF rule setup, yet the analyzed implementation appears narrower and includes undisclosed credentialed access to an internal web system. This discrepancy is security-significant because it obscures actual authority and potential destructive effects from reviewers and operators.

Missing User Warnings

High
Confidence
99% confidence
Finding
The documentation exposes live-looking login credentials for a 5GC dashboard, which could permit unauthorized access if those credentials are valid or reused elsewhere. Given the skill manages core-network elements and policy configuration, compromise of these credentials could directly impact sensitive telecom infrastructure.

Missing User Warnings

High
Confidence
95% confidence
Finding
The default-rule workflow documents automatic deletion and recreation of same-named resources without a prominent destructive warning. Deleting and rebuilding policy objects in a live 5GC environment can interrupt service, break references, or replace intended configuration with defaults.

Missing User Warnings

High
Confidence
99% confidence
Finding
Hardcoded credentials in plaintext are a direct secret exposure: anyone who can read the file, logs, repository history, or packaged skill can recover the account and use it to log into the target system. Because the script targets a management interface for 5GC components, compromise of these credentials could allow unauthorized provisioning or modification of network-core settings.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The script contains hard-coded credentials (`dotouch@dotouch.com.cn` / `dotouch`) and automatically authenticates to a live HTTPS endpoint. Embedding reusable secrets in source code is dangerous because anyone with access to the skill can extract them and gain unauthorized access to the management interface, and the skill context is especially sensitive because it performs privileged 5GC/PCF configuration changes.

Missing User Warnings

High
Confidence
99% confidence
Finding
The automated login uses hard-coded credentials without disclosure or runtime consent, exposing an authenticated administrative account to anyone who can read or run the skill. In this skill's context, the account is immediately used to modify core network policy objects, so compromise of the secret can directly lead to unauthorized changes in PCF/QoS/PCC configuration.

Missing User Warnings

High
Confidence
95% confidence
Finding
The script automatically deletes any existing PCC record with the target ID before recreating it, without strong confirmation, dry-run mode, or safeguards verifying that the object is the intended one. In a live 5GC policy environment, this can disrupt service policy behavior or destroy existing configuration, and an operator or attacker supplying IDs can trigger destructive state changes unintentionally or abusively.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script contains hardcoded credentials and automatically persists session cookies to disk, enabling anyone with access to the code or host filesystem to reuse privileged access to the 5GC management interface. In this skill context, the target is an administrative web console for core network components, so credential leakage or stolen session state could lead to unauthorized configuration changes across sensitive telecom infrastructure.

Context-Inappropriate Capability

High
Confidence
99% confidence
Finding
The script hardcodes a real-looking email/password pair directly into browser automation and uses them to authenticate to an internal HTTPS endpoint. Embedded credentials are dangerous because anyone with access to the skill can reuse them, and they cannot be rotated or scoped safely once the script is copied or shared.

Missing User Warnings

High
Confidence
98% confidence
Finding
The script silently performs credentialed login and caches session cookies without warning the operator. In an automation skill for telecom core management, this creates hidden authentication side effects and leaves behind reusable access artifacts that increase the chance of unauthorized administrative access.

Missing User Warnings

High
Confidence
99% confidence
Finding
Using hard-coded credentials for remote login without disclosure means the skill ships with embedded access to a live system. This is especially dangerous in a 5GC administrative context because compromise of those credentials could allow unauthorized creation or modification of core network policy components.

Missing User Warnings

High
Confidence
98% confidence
Finding
The code not only uses hardcoded credentials but does so without any warning, consent prompt, or disclosure to the operator, making silent privileged access part of normal execution. Because this skill manages 5GC web console state, the hidden credential use is especially dangerous: users may unknowingly perform actions under a shared privileged account, undermining accountability and enabling unauthorized changes.

Missing User Warnings

High
Confidence
99% confidence
Finding
The code silently logs in with a fixed username and password without any disclosure to the user. In a skill context, this is especially dangerous because operators may run the automation without realizing it contains privileged access material, and the exposed credentials can be reused outside the intended workflow against the management interface.

Missing User Warnings

High
Confidence
99% confidence
Finding
The script embeds a real username and password directly in source code and then uses them to authenticate to a live administrative web interface. Hardcoded credentials are dangerous because they are easily leaked through source control, logs, skill distribution, or reuse in other environments, enabling unauthorized access and configuration changes across the 5GC management plane.

Missing User Warnings

High
Confidence
98% confidence
Finding
The code performs an automated login using embedded credentials without any user awareness, consent, or protective handling of the secret. In the context of a 5GC management skill that can modify network-policy state, this materially increases the risk of silent privileged access and misuse if the script is copied, triggered by another agent, or run in an unintended environment.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill documents browser-driven access to a networked 5GC dashboard but does not declare an explicit tool scope such as allowed tools or permissions. In an automation skill that can log in and modify telecom control-plane configuration, undeclared network/browser capability increases the chance of unintended or over-broad execution.

Rp1

Medium
Category
MCP Rug Pull
Confidence
79% confidence
Finding
The documentation instructs users to run 'npx playwright' without pinning a version, which can pull whatever version is current at execution time. That undermines reproducibility and can expose users to supply-chain risk or unexpected behavior changes in a highly privileged automation context.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
Persisted Playwright session caches can retain authentication cookies, tokens, and other sensitive state on disk, enabling later unauthorized reuse by other local users or processes. The risk is higher here because the cached session appears to grant access to a privileged telecom management interface.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
Bulk edit behavior triggered by omitting '--name' can modify all matching resources in a project, but the warning is not sufficiently explicit or prominent. In this context, a single mistaken command could mass-change core 5GC network configuration and cause widespread service impact.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/5gc.js:179