Every outl binary since May shipped the environment of the job that built it
rustpython-vm 0.3 to 0.5 has a build script that writes every environment variable of the build into a generated file, and the interpreter compiles that file in so sysconfig.get_config_vars() can return it. outl's code-block runtime pulled it in on 25 May 2026, so every release from v0.5.1-beta.30 to v0.13.0-beta.256, 28 published prereleases, carried the CI job's environment: GitHub Actions metadata, the Sentry DSN and Blacksmith runner tokens. Bitbison found it and told us privately. What leaked, what didn't, the fix in PR #400, and why the release gate now reads every artifact for runner variable names.
The outl binary on your disk may know the run ID of the GitHub Actions job that built it.
So does every other published release since June. All 28 prereleases from v0.5.1-beta.30 to v0.13.0-beta.256 carry the full environment of the CI job that produced it, compiled in as string constants. That’s the CLI archives, the Homebrew bottles, the desktop app on every platform and the Android APK. Anyone who runs strings on one can read it.
a build script that writes down everything it sees
rustpython-vm 0.3 to 0.5 snapshots its build environment on purpose. This is the tail of main() in the 0.5.0 build.rs, as published on crates.io:
let mut env_path = PathBuf::from(env::var_os("OUT_DIR").unwrap());
env_path.push("env_vars.rs");
let mut f = std::fs::File::create(env_path).unwrap();
write!(
f,
"sysvars! {{ {} }}",
std::env::vars_os().format_with(", ", |(k, v), f| f(&format_args!("{k:?} => {v:?}")))
)
.unwrap();
Every variable cargo hands the build script becomes a "KEY" => "value" pair inside a sysvars! invocation, written to OUT_DIR. Nothing filters it. There’s no allowlist and no prefix check, and the values go in as debug-quoted string literals.
from a generated file to a Python dict
The generated file is spliced into a function that runs on every interpreter. RustPython’s _sysconfigdata module defines build_time_vars, which builds a dict from a hand-written list of CPython-compatible keys and then pulls in the generated file:
macro_rules! sysvars {
($($key:literal => $value:expr),*$(,)?) => {{
$(vars.set_item($key, $value.to_pyobject(vm), vm).unwrap();)*
}};
}
sysvars! {
"EXT_SUFFIX" => format!(".rustpython313-{multiarch}.so"),
// ...
"BLDSHARED" => "cc -shared",
}
include!(concat!(env!("OUT_DIR"), "/env_vars.rs"));
vars
The same macro that sets CC and LDSHARED sets every variable of the build machine. module_exec stores the result as build_time_vars and registers the module under the platform-specific _sysconfigdata_* name that CPython’s sysconfig imports, and the VM’s stdlib table lists _sysconfigdata among the built-in modules. With a full standard library, sysconfig.get_config_vars() hands the whole dict to any Python code that asks.
outl starts its interpreter with Interpreter::without_stdlib, so a code block has no sysconfig to import. That doesn’t help. The pairs are &'static str literals, and the compiler puts them in the read-only data of the binary whether or not anything ever calls the function. The reader that matters is strings.
The upstream fix is a deletion. PR #8813, merged on 24 September, removes those lines from build.rs, drops the now-unused itertools build dependency, and takes out the include!:
);
-
- let mut env_path = PathBuf::from(env::var_os("OUT_DIR").unwrap());
- env_path.push("env_vars.rs");
- ...
- .unwrap();
}
"BLDSHARED" => "cc -shared",
}
- include!(concat!(env!("OUT_DIR"), "/env_vars.rs"));
vars
Three files, one line added, sixteen removed. In 0.6.0, build_time_vars ends at BLDSHARED.
how it got into every outl binary
outl runs Python code blocks through RustPython, behind the lang-python feature of outl-exec. That feature is on by default:
default = ["lang-js", "lang-python", "lang-lua", "lang-rust", "lang-query"]
lang-python = ["dep:rustpython-vm"]
Everything we ship depends on outl-exec. cargo tree --workspace -i rustpython-vm at the beta.256 tag shows the path: outl-exec is pulled in directly by outl-cli and outl-desktop, and again through outl-actions by outl-mobile, outl-tui, outl-plugins and the sync crates. The CLI, both desktop builds and both mobile apps link the interpreter, so all of them link the generated file. The dependency came in with commit 3e544c02 on 25 May 2026, and from the next beta on, every release build compiled the runner’s environment into the binary.
why the build script saw our secrets
A build script inherits cargo’s environment, and cargo inherits the step’s. There’s no sandbox between them. Whatever the CI step exports, cargo passes down, and std::env::vars_os() in a dependency’s build.rs sees all of it.
In GitHub Actions, where you put env decides which steps get it. A key under jobs.<id>.env goes to every step in that job. A key under steps[*].env goes only to that step. Most of our build secrets were already step-scoped, which is why the dump didn’t contain the signing certificate, its password or the provisioning profile: they existed only in the steps that installed them, not in the step that ran cargo. The keychain password was the exception. This is what mobile.yml had on the ios-release job before the fix:
environment:
name: release
env:
KEYCHAIN_PWD: ${{ secrets.MAC_KEYCHAIN_PASSWORD }}
steps:
The same job runs cargo tauri ios build to produce the archive, so the build script would have seen it. What’s left in every dump is what the runner exports to every step on its own: GITHUB_* metadata, RUNNER_* paths and the Blacksmith runner’s own variables.
why cargo audit stayed quiet
Nothing warned us. cargo audit and cargo deny match the lockfile against the RustSec database, and there was never an advisory to match against. RustPython fixed it upstream in PR #8813, from issue #8802, and shipped the fix in 0.6.0 on 2 October. A fix that ships without an advisory reaches the projects that happen to bump, and we hadn’t bumped. We couldn’t have picked it up by accident either: outl-exec asked for "0.5", which cargo reads as ^0.5, and for a 0.x crate a caret requirement never crosses a minor version. cargo update would have kept us on 0.5.0 forever. Bitbison has since opened issue #9236 upstream, asking the RustPython maintainers to confirm a RustSec advisory for 0.3.0 through 0.5.0 and to consider a GitHub Security Advisory, so cargo audit, cargo deny and Dependabot warn the projects still on the old versions. They found the same leak in the published binaries of four dependants, outl among them.
what was in there, and what wasn’t
This is a slice of the read-only data in the beta.256 Linux outl binary, with every value replaced. In the file, names and values are packed back to back with no separator, which is how the compiler lays out string literals:
GITHUB_REF_TYPE<redacted>GITHUB_REPOSITORY<redacted>GITHUB_REPOSITORY_ID<redacted>
GITHUB_REPOSITORY_OWNER<redacted>GITHUB_REPOSITORY_OWNER_ID<redacted>
GITHUB_RETENTION_DAYS<redacted>GITHUB_RUN_ATTEMPT<redacted>GITHUB_RUN_ID<redacted>
GITHUB_RUN_NUMBER<redacted>GITHUB_SERVER_URL<redacted>GITHUB_SHA<redacted>GITHUB_STATE
It sits a few strings after EXT_SUFFIX, build_time_vars and BLDSHARED, the hand-written keys from that module, which is how you can tell where it came from.
I downloaded every v0.13.0-beta.256 asset and counted unique variable names by prefix. The Linux CLI archive alone held 23 GITHUB_* names, 11 RUNNER_*, 7 ACTIONS_* and 29 BLACKSMITH_*, and the other assets came out in the same range. Most of that is metadata: run IDs, repository and ref names, runner paths. Three things matter more than that.
Blacksmith runner tokens. Our build jobs run on Blacksmith, and its runner exports tokens for its cache, sticky disks, job completion and monitoring. Those were in the binaries with values next to them. If they outlive the job, someone could use one against our build cache. I’ve asked Blacksmith’s security team whether they’re scoped to a single job and expire with it, and I’ll update this post when they answer.
The Sentry DSN. The crash reporter already compiles a DSN into every release binary on purpose. outl-telemetry reads it at compile time with const DSN: Option<&str> = option_env!("OUTL_SENTRY_DSN");, so it’s None in every build outside our release pipeline. That’s the reason the variable was in the environment of the build step at all, and the dump added a second copy next to its name. The threat model doesn’t change: a DSN carries only the public key a client needs to submit events, so whoever holds it can send fake crash reports and burn quota, but can’t read the reports we already have. Any client that reports crashes has to ship one.
No GitHub tokens. GITHUB_TOKEN and the other credentials Actions hands out aren’t exported as plain environment variables to every step, and none turned up in any asset.
The keychain password, set where it shouldn’t have been. mobile.yml set the iOS signing keychain password at job level, so every step in that job inherited it, the Rust build included. The IPA isn’t attached to releases and I can’t scan the builds already sent to TestFlight, so I haven’t proven the password reached them. The way the build works, it’s likely it did, so I treat it as exposed. It hasn’t been rotated yet, and it will be before the stable patch ships. The first IPA built after the fix passed the same release gate as everything else.
found from the outside, and reported privately
Bitbison runs an open-source registry at registry.bitbison.io that builds crates.io releases in a sandbox and records what they do. Building outl-exec 0.13.0-beta.256 there surfaced the problem, and they wrote to us privately before saying anything in public. They had downloaded three beta.256 assets, checked them against our .sha256 files and scanned them for strings without running them: the Linux and arm64 macOS bottles and the Android APK. The report named the dependency and the upstream fix, listed what they found (about 40 GITHUB_, RUNNER_ and ACTIONS_ variables with their values, BLACKSMITH_SSH_PORT and the Sentry DSN), pointed at the job-level keychain password in mobile.yml by line number, and suggested moving secrets onto the steps that use them. That made checking it a matter of hours rather than days.
You don’t need to send a patch to help. Bitbison didn’t open a pull request against outl, and they didn’t need to. A private note that says what’s wrong, where, and how you checked is already most of the work, and the fix took an afternoon once I knew where to look. I’m glad there are people this careful who spend their time reading other projects’ binaries and then take the trouble to tell the maintainer first. Thank you.
the fix, in three parts that don’t depend on each other
PR #400 does three things, and each would have been enough to catch or contain this on its own.
rustpython-vm 0.6. Our own code didn’t change: the Interpreter::without_stdlib, enter, compile and run_code_obj calls in runtimes/python.rs are the same in 0.6. Getting there still took three fixes, each found by something failing.
Secrets live on the step that reads them. A job-level env is inherited by every step in the job, including the ones that compile code. The keychain password and the App Store Connect IDs moved to the steps that use them. None of our other workflows set a secret at job level.
three things the bump broke
A patch release that isn’t one. The first cargo check after the bump failed inside RustPython, not in outl:
error[E0026]: struct `ruff_python_ast::ExprCompare` does not have fields named `left`, `comparators`
error[E0599]: no method named `as_slice` found for struct `FStringValue` in the current scope
error: could not compile `rustpython-codegen` (lib) due to 10 previous errors
rustpython-codegen 0.6.0 asks for rustpython-ruff_python_ast = "0.16.5", which cargo reads as ^0.16.5, so it resolved to 0.16.10, and 0.16.10 changed the AST shape in a patch release. Pinning only the AST crate wasn’t enough, because the parser at 0.16.5 then failed against a 0.16.10 ruff_text_size. All five rustpython-ruff_* crates are pinned at 0.16.5 in Cargo.lock. The pin lives only in the lockfile, so a cargo install without --locked can still pick up the broken combination until upstream fixes it.
A stack that was big enough until it wasn’t. With the build green, all six Python tests failed the same way:
File "codecs", line 16, in <module>
File "<frozen importlib._bootstrap>", line 438, in _get_module_lock
RecursionError: maximum recursion depth exceeded while hashing
thread 'outl-exec' panicked at .../rustpython-vm-0.6.0/src/vm/mod.rs:1544:30:
essential initialization failed
0.6 runs an essential_init on every interpreter, without_stdlib included: it imports _typing, _ast and _io, installs the frozen importlib, and imports codecs and the ASCII, UTF-8 and Latin-1 encodings. Code blocks run on a worker thread so a runaway script can’t hold the caller past its timeout, and Rust gives a spawned thread 2 MiB of stack. The same tests passed with RUST_MIN_STACK=16777216, so the worker now asks for 16 MiB explicitly in sandbox.rs. That’s address space reserved, not memory used.
A Windows module that ignores its own feature flag. Linux and macOS were green, and the Windows job failed:
error[E0432]: unresolved import `crate::ctypes`
error: could not compile `rustpython-host_env` (lib) due to 5 previous errors
rustpython-host_env 0.6.0 declares pub mod ctypes behind #[cfg(feature = "ctypes")], but declares pub mod wmi behind #[cfg(windows)] alone, and wmi.rs calls crate::ctypes::wcslen. rustpython-vm only turns ctypes on through its host_env feature, which we keep off because we don’t want the host OS modules in the sandbox. So outl-exec names the crate directly, on Windows only:
[target.'cfg(windows)'.dependencies]
rustpython-host_env = { version = "0.6", optional = true, default-features = false, features = ["ctypes"] }
ctypes pulls in libffi, and on MSVC libffi-sys builds libffi from source instead of looking for a system copy, so the runner needs nothing new. I’ve only build-tested the Python runtime on Windows. I haven’t run it there.
a gate that opens the file
The release gate reads the finished binary. scripts/check-artifact-stripped.py already opened every artifact we ship to check that debug info was stripped. It doesn’t trust file names: tarballs (.tar.gz, .tgz, .tar) and zip containers (.zip, .apk, .ipa, .aab, .jar) are walked member by member, every member is checked for an ELF, Mach-O or PE header, and files whose whole job is to carry debug info (.dSYM, .pdb, .dwp and friends) are skipped. Finding no binary at all is a failure, because a check that read nothing hasn’t passed. Every binary it does find now also goes through check_build_env, which fails on names that every CI job exports and our own source never contains:
BUILD_ENV_MARKERS = (
b"GITHUB_RUN_ID",
b"RUNNER_TEMP",
b"ACTIONS_RUNTIME",
b"BLACKSMITH_",
)
def check_build_env(name, blob):
return [
f"{name}: embeds the CI build environment ({marker.decode()} found)"
for marker in BUILD_ENV_MARKERS
if marker in blob
]
Matching the name is enough. A binary that contains the name of a runner variable got it from a snapshot of the runner, and looking for names means the check doesn’t need to know any secret’s value. The release workflow already called the script on the CLI archives and bottles, the macOS app, the AppImage, deb and rpm payloads, the Windows exe and the APK, and mobile.yml calls it on the IPA, so the new rule reached every artifact without touching a workflow.
--allow-build-env turns the rule into a warning for a binary we didn’t build, like the prebuilt AppRun the AppImage step downloads, and no step passes it. Run against the published beta.256 Linux archive, it fails on three of the four: GITHUB_RUN_ID, RUNNER_TEMP and BLACKSMITH_. Locally, a release outl built with fake values for all four variables set passed it, and none of the fake values appeared anywhere in the file. A release dry run on the PR branch passed it on all eight build jobs with no false positives, and the iOS job’s gate passed on the IPA after the merge.
checked on what people actually download
v0.13.0-beta.259 is the first release built with the fix. I downloaded all thirteen assets and scanned each one with the same counts as before: zero RUNNER_*, ACTIONS_* and BLACKSMITH_* names in every asset, against 10 to 11, 6 to 7 and 21 to 29 in beta.256. Each asset still has one string that starts with GITHUB_: GITHUB_AH, which isn’t a variable name, just bytes that happen to spell it. What’s left of the DSN is the one copy the crash reporter puts there on purpose.
what to do
Upgrade. brew upgrade outl-beta, or download v0.13.0-beta.259 or later from the releases page. A stable patch release built with the same fix is next.
You don’t need to change anything on your side. The tokens and the password were ours, not yours, and nothing in the leaked environment touched your pages or your sync.
if you ship Rust binaries from CI
A dependency’s build script runs with your CI job’s full environment, and anything it writes into OUT_DIR can end up in your binary. That’s true of every crate you depend on, not just this one. Two habits would have contained this for us:
- Put secrets on the step that needs them, never on the job or the workflow. The compile step should run with as little in its environment as you can manage.
- Check the artifact you publish, not the pipeline that made it. Grep the finished binary for a few variable names your runner always sets. If one shows up, something compiled your environment in.
Flaws like this are normal. Every project of any size runs code it didn’t write and can’t read line by line, and some of that code will do something surprising. outl didn’t write this build script and never looked inside it. What a project controls is how fast it finds out, how it contains the damage, and whether it says plainly what happened. That’s why this post exists, with the release range and the variable names in it.
The lesson isn’t to distrust build scripts. It’s that “the build is green” says nothing about what’s inside the file, and the only check that can see inside is one that opens it.
The fix is in outl PR #400, and the gate is in scripts/check-artifact-stripped.py in the outl repository.