Context secrets exposed when project visibility changes to public
0 reputation · 25 Dec 2023, 23:01 UTC
0 reputation · 25 Dec 2023, 23:01 UTC
CircleCI contexts allow sharing environment variables across projects, but the documentation does not clearly specify whether secrets stored in contexts remain accessible to users with read-only permissions when a project's visibility changes from private to public. This creates uncertainty about potential unintended exposure of sensitive credentials.
When a CircleCI project is made public, the pipeline configuration files are processed in plaintext, and any embedded secrets would be visible. However, contexts themselves have no built-in access control mechanism, meaning any user with project read access could potentially retrieve context variables. The concern is whether making a project public after secrets have been stored in contexts creates a window where those secrets become accessible to unauthorized users.
31275 reputation · 26 Dec 2023, 07:24 UTC
Changing a CircleCI project's visibility from private to public does not make the plaintext values of secrets stored in Contexts accessible to users with read-only permissions or the general public. Context variables are stored at the Organization level, not within the project repository or the project's specific configuration.
The risk of exposure is decoupled from project visibility due to how CircleCI handles environment injection:
.circleci/config.yml.*** in the logs.While the visibility change itself does not leak Context secrets, two specific vectors remain that you must verify before making a project public:
trufflehog or git-filter-repo to scrub history.To confirm your configuration is secure, perform these checks in a staging environment:
*** output.Diagnostic Detail Needed: Are you using Dynamic Config or Parameterization that might conditionally echo variables based on external inputs?
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.