Back to skill

Security audit

PigX Server 后端开发

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent PigX backend development guide, but it publishes real-looking database and configuration-decryption credentials without limiting them to disposable local use.

Review and rotate any postgres/postgres or pigx configuration password before using this guidance in a shared, test, staging, or production environment. Treat the Maven commands as actions that may modify files, create build outputs, download dependencies, or start services, and only run them in the intended project workspace.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:204
Finding

Hardcoded PostgreSQL Administrative Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 204-205
Vulnerability Type: Hardcoded plaintext database credentials
Risk Level: High

Vulnerable code snippet:

yaml
username: postgres
password: postgres

Technical Analysis

The skill documentation exposes a static PostgreSQL username and password. The postgres account is commonly configured as a database superuser, while the password is identical to the username and is easily guessed.

Although the example uses a localhost database URL, developers may copy this configuration into shared, containerized, testing, or production environments. If PostgreSQL is reachable from another host and the documented credentials remain active, an attacker can authenticate without needing to discover or crack a secret.

Attack Path

  1. An attacker obtains the skill documentation or recognizes that a target uses the documented PigX configuration.
  2. The attacker identifies a reachable PostgreSQL service associated with the deployment.
  3. The attacker attempts authentication using the disclosed postgres username and postgres password.
  4. If the documented default remains active, the attacker authenticates as the PostgreSQL account.
  5. Depending on the account configuration, the attacker reads or modifies application data, creates additional database roles, changes permissions, or executes database features available to that account.

Exploitation requires the credentials to remain unchanged and the database to be accessible to the attacker.

Impact Assessment

A successful attacker could obtain access to all databases and records available to the postgres account. If it retains its usual superuser privileges, the scope may include complete database confidentiality, integrity, and availability compromise, role and permission administration, and access to database-server capabilities exposed to PostgreSQL superusers.

Remediation
View remediation

Remediation Suggestions

  • Remove functional usernames and passwords from the documentation.
  • Replace them with explicit nonfunctional placeholders such as ${DB_USERNAME} and ${DB_PASSWORD}.
  • Load credentials from environment variables, mounted secret files, or a managed secrets platform.
  • Generate a unique, high-entropy database password for every environment.
  • Avoid using the PostgreSQL superuser for application connections. Create a dedicated role with only the required schema and operation privileges.
  • Restrict PostgreSQL network exposure through firewall rules, private networks, and restrictive pg_hba.conf entries.
  • Rotate postgres/postgres immediately in every deployment where it may have been copied or retained.
  • Add secret scanning to documentation and repository CI checks to prevent future credential disclosure.

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:219
Finding

Disclosure of Encrypted Configuration Password

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 219
Vulnerability Type: Hardcoded configuration decryption password
Risk Level: High

Vulnerable documentation statement, rendered in English:

text
Security configuration: Configuration files are encrypted; the password is `pigx`.

Technical Analysis

The skill explicitly discloses the password used to protect encrypted configuration files. Encryption does not provide meaningful secrecy when the decryption password is distributed alongside instructions for accessing the protected material.

The fixed value pigx is also short and predictable. If encrypted configuration files contain database, API, object-storage, service-discovery, or other infrastructure credentials, anyone who obtains those files and knows the documented password may be able to recover their plaintext contents.

Attack Path

  1. An attacker obtains the skill documentation and learns that the configuration password is pigx.
  2. The attacker acquires an encrypted configuration file through repository access, a leaked artifact, an exposed configuration service, a backup, or another independent access path.
  3. The attacker uses pigx with the application's supported configuration decryption mechanism.
  4. If the documented password remains valid, the attacker decrypts the protected values.
  5. The attacker uses any recovered service credentials to access the corresponding databases, APIs, storage systems, registries, or internal services.

Exploitation requires access to encrypted configuration material or a service that accepts the disclosed password.

Impact Assessment

The direct impact is loss of confidentiality for configuration values protected by this shared password. The resulting scope depends on the contents of the encrypted configuration and may extend to unauthorized access to multiple application services and infrastructure components. Privileges obtained w ...[truncated 140 chars]

Remediation
View remediation

Remediation Suggestions

  • Remove the configuration password from the skill documentation and repository history.
  • Rotate pigx anywhere it is currently used and re-encrypt affected configuration values with a unique, high-entropy key.
  • Store decryption keys separately from encrypted configuration, preferably in a managed key-management or secrets-management service.
  • Use separate keys for development, testing, staging, and production to prevent compromise of one environment from affecting others.
  • Restrict access to encrypted configuration artifacts and configuration-management services.
  • Audit access logs and rotate credentials contained in configuration files that may have been decryptable with the disclosed password.
  • Establish automated secret scanning and prohibit documentation from containing operational decryption keys.
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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The description, headings, and instructions are all written in Chinese, effectively imposing a single language for use of the skill. The file does not mention that Chinese is optional, provide an alternative language, or justify a Chinese-only constraint as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill includes concrete build and run commands (mvn clean install, profile builds, module builds, formatting, and spring-boot:run) that can change the local workspace, download dependencies, start services, and consume system resources, but it does not warn the user before suggesting potentially state-changing actions. In an agent setting, omission of such warnings increases the risk of unreviewed local modifications or unintended environment changes, even though the content appears to be standard developer guidance rather than overtly malicious.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.