T09 · Insecure Skill Coding Practices
Error
- Location
- assets/docker-compose.yml:8
- Finding
- Deployment Uses Predictable Default Credentials on a Network-Exposed Service<![CDATA[ ## Vulnerability Details **File Location**: `assets/docker-compose.yml:8-34` **Vulnerability Type**: Hardcoded and predictable credentials **Risk Level**: High ### Vulnerable Code ```yaml ports: - "8080:80" environment: - LOCALE=en-US - DB_HOST=akaunting-db - DB_PORT=3306 - DB_DATABASE=akaunting - DB_USERNAME=akaunting - DB_PASSWORD=akaunting_secure_password - DB_PREFIX=ak_ - COMPANY_NAME=My Company - COMPANY_EMAIL=admin@example.com - ADMIN_EMAIL=admin@example.com - ADMIN_PASSWORD=changeme123 # ... environment: - MYSQL_ROOT_PASSWORD=root_secure_password - MYSQL_DATABASE=akaunting - MYSQL_USER=akaunting - MYSQL_PASSWORD=akaunting_secure_password ``` ### Technical Analysis The Compose configuration embeds fixed administrator, database-user, and database-root passwords. These values are distributed with the project and are therefore not secret. Users following the deployment instructions may run the service without replacing them. The port mapping `8080:80` binds the Akaunting web service to all host interfaces by default. If the host is reachable from an untrusted network, an attacker can attempt to authenticate with the documented administrator identity and password. The database is not directly published by this Compose file, which limits immediate remote database exposure. Nevertheless, the static database credentials remain available to processes with access to the Compose configuration, container environment, Docker API, application container, or internal Docker network. ### Attack Path 1. A user deploys the supplied Compose configuration without changing its default values. 2. Docker exposes the Akaunting application on host port 8080. 3. An attacker discovers the reachable service. 4. The attacker authenticates using `admin@example.com` and `changeme123`. 5. The attacker gains the privileges assigned to the initialized administrator account. 6. If the attacker subsequently obtains container or internal-n ...[truncated 669 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove all passwords from the committed Compose file. - Require credentials to be supplied through Docker secrets, a protected environment file, or an external secrets manager. - Generate unique, cryptographically random administrator, database-user, and database-root passwords for every deployment. - Add startup validation that rejects known example or default passwords. - Bind the service to loopback by default, for example: ```yaml ports: - "127.0.0.1:8080:80" ``` - If remote access is required, place the service behind an authenticated TLS reverse proxy and restrict access with firewall rules. - Rotate all credentials on deployments that may already have used these defaults. - Avoid using the application administrator account for routine API automation; create a dedicated account with only the required API permissions. ]]>
