How to Recover a GitHub Actions Secret Using Hex Encoding to Bypass Masking
GitHub hides secret values after they are saved, allowing only overwrites, which can be problematic if the stored secret is the sole surviving copy of a critical credential. While GitHub masks both plain and base64-encoded forms of secrets in workflow logs, its masking system only blocks output formats it can predict in advance. A developer-shared workaround involves encoding the secret as a hex dump, reversed string, or spaced characters inside a workflow file, none of which match the registered mask patterns. Running such a workflow via the Actions tab exposes the encoded value in logs, which can then be decoded locally to retrieve the original secret. GitHub acknowledges that workflow secret masking is best-effort rather than a security boundary, since any user with workflow-run access can emit secrets in arbitrary encodings.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in