T09 · Insecure Skill Coding Practices
- Location
SKILL.md:65- Finding
Weak Replication Credentials and Unrestricted Source Host
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 65–67
Vulnerability Type: Weak hardcoded example credentials and overly broad network authorization
Risk Level: HighVulnerable Code
sql CREATE USER 'repl'@'%' IDENTIFIED BY 'password'; GRANT REPLICATION SLAVE ON *.* TO 'repl'@'%'; FLUSH PRIVILEGES;Technical Analysis
The documented replication account uses the predictable password
passwordand the MySQL host wildcard%. If operators copy this example without replacing and restricting its values, the account can authenticate from any network location that can reach the MySQL service.Although
REPLICATION SLAVEis narrower than full administrative access, it permits replication clients to request binary log data. Binary logs can contain sensitive application data and database changes. The wildcard host also violates least-privilege access-control principles by exposing the account beyond the intended replica.Attack Path
- An operator follows the procedure without replacing the example password or restricting the account host.
- MySQL port 3306 becomes reachable by an attacker through a public interface, internal network, VPN, compromised host, or misconfigured security group.
- The attacker authenticates as
replusing the predictable password. - The attacker registers a replication client and requests available binary logs.
- Sensitive database changes contained in those logs are disclosed within the account's replication access and the server's retained log range.
Impact Assessment
A successful attacker can obtain the privileges assigned to the replication account and potentially read retained binary log events. The affected scope can include changes across all databases because the privilege is granted on
*.*. This may expose customer records, application secrets stored in databases, schema changes, and other replicated data. It does not directly grant full MySQL administrative privileges.- Remediation
View remediation
Remediation Suggestions
- Replace literal credentials with explicit placeholders that cannot be mistaken for usable production values.
- Generate a unique, high-entropy password through an approved secret-management system.
- Replace
'repl'@'%'with an account restricted to the replica's exact IP address or the narrowest required subnet. - Restrict port 3306 using host firewalls, cloud security groups, and private networking.
- Require encrypted MySQL connections and validate server certificates where supported.
- Store the credential in an approved secret manager and establish rotation and revocation procedures.
- Add a warning that examples must never be copied unchanged into production.
- Periodically audit replication users, grants, source hosts, and authentication logs.
