Repository navigation
Description
Overly Broad File Inclusion Exposes Secrets
Affected commit
Repository: https://github.com/zidsa/vitrin-cli
Git commit: 45e59e4983cec15e11845582d337ff122f62c61c
Description
The CLI tool packages the current working directory into a ZIP archive for deployment using a highly permissive glob pattern. The configuration explicitly ignores only .git, node_modules, .vitrin, and .zip files, lacking provisions to exclude common sensitive files such as .env, .npmrc, or IDE configuration directories. Because of this broad inclusion, any local environment variables, developer credentials, or private configuration files residing in the theme directory are silently archived and transmitted to the remote platform. This behavior strips the developer of control over what gets deployed and can inadvertently publish access tokens, local database passwords, and other secrets. Ineffective controls include the hardcoded ignore array, which blocks common large directories but fails to implement a comprehensive deny-list for secrets or respect standard ignore files, leaving secrets exposed during the push operation.
Steps to Reproduce
- A developer places an .env file containing secrets (e.g., API_KEY=secret) in the root of their theme repository.
- The developer runs the deployment command to push their theme updates.
- The application archives all files matching **/*, inadvertently including the .env file because it does not match the restricted ignore list.
- The generated theme.zip containing the secrets is uploaded to the remote server.
- The attacker downloads the theme package or accesses the exposed file on the platform, extracting the developer's credentials.
Expected impact
- Unauthorized exposure of local developer secrets, access tokens, and environment variables.
- Potential compromise of associated infrastructure or third-party services if valid credentials are leaked.
Demonstrated Impact
The production archive rules included credentials.json in the publish archive.
Scope and Limitations
A secret-bearing file must exist in the theme directory and not match an ignore rule. Dotfiles such as .env and .npmrc were excluded by the glob implementation in this test.
Activity