惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园_首页
博客园 - 【当耐特】
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
WordPress大学
WordPress大学
D
Docker
T
The Blog of Author Tim Ferriss
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Azure Blog
Microsoft Azure Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
月光博客
月光博客
M
MIT News - Artificial intelligence
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
云风的 BLOG
云风的 BLOG
F
Fortinet All Blogs
罗磊的独立博客
小众软件
小众软件
A
About on SuperTechFans
MyScale Blog
MyScale Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
C
Check Point Blog
L
LangChain Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Read your own GitHub Actions secret back (when base64 get...
The AX code · 2026-06-28 · via DEV Community
Cover image for Read your own GitHub Actions secret back (when base64 gets masked too)

The AX code

GitHub deliberately won't show you a secret's value after it's saved — you can only overwrite it. Usually that's fine. But sometimes the value you stored is the only surviving copy of something you need back — a signing password, an API key you didn't save elsewhere — and you have write access to the repo's workflows.

You can recover it. Here's the specific workaround.

Why the obvious tricks fail

GitHub scans log output and replaces any exact match of a registered secret with ***:

- run: echo "${{ secrets.MY_SECRET }}"     # -> ***

The classic bypass was base64. That's covered now too — GitHub registers and masks the base64 form of secrets:

- run: echo "${{ secrets.MY_SECRET }}" | base64   # -> ***

Masking is string replacement on output, so it only catches forms it can predict. Re-encode the bytes into one it doesn't register and it prints fine. A hex dump works:

The workflow

# .github/workflows/recover-secret.yml
name: Recover secret
on: workflow_dispatch
jobs:
  reveal:
    runs-on: ubuntu-latest
    steps:
      - env:
          S: ${{ secrets.MY_SECRET }}
        run: |
          echo "hex   : $(printf %s "$S" | od -An -tx1 | tr -d '\n')"
          echo "rev   : $(printf %s "$S" | rev)"
          echo "spaced: $(printf %s "$S" | sed 's/./& /g')"
          echo "length: $(printf %s "$S" | wc -c)"

Commit it, then Actions → Recover secret → Run workflow. The log shows:

hex   :  70 61 73 73 77 6f 72 64
rev   : drowssap
spaced: p a s s w o r d
length: 8

  • hex is the reliable one. Decode locally:
  echo '70 61 73 73 77 6f 72 64' | tr -d ' ' | xxd -r -p; echo   # -> password

  • rev reads backwards; spaced is the value with a space between each character.

All three survive masking because none is a literal or base64 match of the secret. length is a sanity check.

After you have it

  • Delete the workflow and its run logs — the value is now sitting in plaintext in your Actions history.
  • Rotate the secret if you can. Re-setting it (even to the same value) re-registers the mask.

One caveat worth stating

This isn't a GitHub bug, and it's not a way past their security model — GitHub documents masking as best-effort, not a boundary, precisely because a workflow runs your code with the secret in plaintext and can emit it in unlimited encodings. The real control is who can run workflows: anyone with that access can read the secrets it sees. Use this only on a repo you own, to recover a value that's yours.