Skip to content

Overly Broad File Inclusion Exposes Secrets #8

Open

Description

@percpyc

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

  1. A developer places an .env file containing secrets (e.g., API_KEY=secret) in the root of their theme repository.
  2. The developer runs the deployment command to push their theme updates.
  3. The application archives all files matching **/*, inadvertently including the .env file because it does not match the restricted ignore list.
  4. The generated theme.zip containing the secrets is uploaded to the remote server.
  5. 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.

Private vulnerability report

https://github.com/zidsa/vitrin-cli/security/advisories/GHSA-9wm6-c5j8-79ph

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions