T09 · Insecure Skill Coding Practices
- Location
SKILL.md:67- Finding
Hardcoded Administrative Credentials Exposed in Command-Line Example
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 67
Vulnerability Type: Hardcoded weak credentials and plaintext secret exposure
Risk Level: MediumVulnerable Code:
bash surreal sql --endpoint http://localhost:8000 --user root --pass root --ns test --db testTechnical Analysis
The example supplies the predictable administrative credential
root/rootdirectly through command-line arguments. Users who copy this command may deploy a SurrealDB instance with weak credentials or expose an existing credential in plaintext.Command-line secrets can be retained in shell history and may be visible to local process-inspection mechanisms while the process is running. The use of the
rootaccount also violates least-privilege principles because it grants broader database permissions than are normally required for extension development and testing.The endpoint is explicitly local, which limits direct remote exposure in the documented configuration. However, the risk increases if users reuse the example against an externally reachable instance, bind the service to a non-loopback interface, or retain the same credentials outside an isolated development environment.
Attack Path
- A user copies and runs the documented command with the
root/rootadministrative credential. - The plaintext password is recorded in shell history or temporarily exposed through process arguments.
- An attacker with local access, access to command-history files, or suitable process-inspection permissions obtains the credential.
- The attacker connects to the SurrealDB endpoint while the credential remains valid.
- The attacker authenticates as
rootand exercises the administrative permissions assigned to that account.
If the database is exposed beyond localhost and still uses the documented credential, an attacker may instead attempt the predictable
root/rootcombination directly.Impact Assessment
...[truncated 555 chars]
- A user copies and runs the documented command with the
- Remediation
View remediation
Remediation Suggestions
- Remove hardcoded passwords from command examples.
- Instruct users to create a strong, unique credential during initial database setup.
- Use an interactive password prompt or a supported protected secret mechanism rather than passing the password as a command-line argument.
- Demonstrate a dedicated, least-privileged development account instead of the
rootaccount. - Clearly label any development-only credentials and warn users never to reuse them in shared, production, or remotely reachable environments.
- Restrict development database listeners to the loopback interface unless remote access is explicitly required.
- Advise affected users to rotate credentials and remove exposed commands from shell-history files where appropriate.
