Skip to content
Open-Source Registry

cargo / koios / 0.1.1

koios 0.1.1

bitbison: flagged, behavior flagged, dependencies flagged, posture not checked, pipeline clean, 1 of 1 jobs captured RiskhighVulnshigh
processes
202
operations
35K
packages
147
compiler runs
184
connections
1
build time
39s
job time
39s
capture
452 KB
records
62K
bytes / record
7.2
run e766db36-5fab-4978-918c-4f51a3147e4c · built 2026-11-02 · complete View on crates.io
Reviewed by Bitbison: secrets-exposurekoi takes its OpenAI key from a flag, its config file or a prompt, but it checks OPENAI_API_KEY with option_env!, which reads the variable when the crate is compiled: a key exported during `cargo install koios` is written into the binary and used from then on.

Graph

binary · retained · product · graph v2
2

Checks

12 of 16 clear Sensitive data access and transfer Known vulnerabilities +2 more
Build behavior✓▲✓✓✓✓✓✓✓✓
Supply chain▲▲▲✓✓
Pipeline✓

Detections

2
  • koi contains OPENAI_API_KEY
    koi
    high
  • 1 credentials copied into 5 files
    dep-bin-koi
    low

Detection

highwitnessed

koi contains OPENAI_API_KEY

Credential copied by the build

Subject
/home/runner/work/koi/koi/target/release/koi
Jobs
build-test
Rule
credential-copied

Evidence

  1. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/koi

    subject /home/runner/work/koi/koi/target/release/koi

  2. Why it matterscontext

    Credentials were exposed in this file.

Remediation

Remove what writes the credential into the artifact: anyone who has the artifact has the credential.

Detection

lowwitnessed

1 credentials copied into 5 files

Credential copied by the build

Subject
/home/runner/work/koi/koi/target/release/.fingerprint/koios-4da7f022df5f6d6e/dep-bin-koi
Reaches
koi-4da7f022df5f6d6emember
Jobs
build-test
Rule
credential-copied · koi

Evidence

  1. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/.fingerprint/koios-4da7f022df5f6d6e/dep-bin-koi, written by cargo

    subject /home/runner/work/koi/koi/target/release/.fingerprint/koios-4da7f022df5f6d6e/dep-bin-koi

    by /home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/cargo build --release --locked --message-format=json-render-diagnostics

  2. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/.fingerprint/koios-f895c3d16cd73293/dep-test-bin-koi, written by cargo

    subject /home/runner/work/koi/koi/target/release/.fingerprint/koios-f895c3d16cd73293/dep-test-bin-koi

    by /home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/cargo test --release --locked --no-fail-fast

  3. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/deps/koi-4da7f022df5f6d6e, written by rust-lld

    subject /home/runner/work/koi/koi/target/release/deps/koi-4da7f022df5f6d6e

    by /home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/rust-lld -flavor gnu -plugin /usr/libexec/gcc/x86_64-li…

  4. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/deps/koi-4da7f022df5f6d6e.d, written by rustc

    subject /home/runner/work/koi/koi/target/release/deps/koi-4da7f022df5f6d6e.d

    by /home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/rustc --crate-name koi --edition=2021 src/main.rs --error-format=json --json=diagnostic-rend…

  5. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/koi/koi/target/release/deps/koi-f895c3d16cd73293.d, written by rustc

    subject /home/runner/work/koi/koi/target/release/deps/koi-f895c3d16cd73293.d

    by /home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/rustc --crate-name koi --edition=2021 src/main.rs --error-format=json --json=diagnostic-rend…

  6. Why it matterscontext

    Credentials were exposed in this file.

In koi

Loading the graph

Processes

build-test

cargo›cargo

Ran
/home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/cargo build --release --locked --message-format=json-render-diagnostics
Invoked by
cargo build --release --locked --message-format=json-render-diagnostics
Lineage · 2 processes
  1. cargocargo build --release --locked --message-format=json-render-diagnostics2553
  2. cargo/home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/cargo build --release --locked --message-format=json-render-diagnostics2553

Remediation

Keep credentials out of build output: logs, caches and build directories outlive the job.

Network

1 peers
  • static.crates.io:8080 the package manager · cargo (koi) via crates.io · 11,983 files · went into an output ecosystem
Vulnerabilities18FixSeverity
Dependencies
h2 0.3.16>=0.4.16
RUSTSEC-2026-0258h2 unbounded empty DATA frameshigh
CVE-2023-26964h2 vulnerable to denial of servicemedium
GHSA-8r5v-vm4m-4g25Resource exhaustion vulnerability in h2 may lead to Denial of Service (DoS)medium
GHSA-q6cp-qfwq-4gcvh2 servers vulnerable to degradation of service with CONTINUATION Floodmedium
mio 0.8.6>=0.8.11
CVE-2024-27308Mio's tokens for named pipes may be delivered after deregistrationhigh
rustls 0.19.1>=0.23.46
CVE-2024-32650Denial of Service Vulnerability in Rustls Libraryhigh
GHSA-c8m5-c952-6cm4Rustls: Session Debug formatting exposes TLS master secrets and resumption PSKsmedium
GHSA-h2v8-394m-p7vvRustls: Brotli certificate decompression can allocate an attacker-controlled amount of memory up to 1 GiB before authentication.low
GHSA-w44r-93j7-qv28rustls: An unauthenticated ServerHello poisons the per-name key-exchange record, so later ClientHellos carry only a classical X25519 sharelow
webpki 0.21.4>=0.22.2
GHSA-8qv2-5vq6-g2g7webpki: CPU denial of service in certificate path buildinghigh
bytes 1.4.0>=1.11.1
CVE-2026-25541bytes has integer overflow in BytesMut::reservemedium
ring 0.16.20>=0.17.12
CVE-2025-4432Some AES functions may panic when overflow checking is enabled in ringmedium
RUSTSEC-2025-0010Versions of *ring* prior to 0.17 are unmaintained.low
rustix 0.36.11>=0.36.16
CVE-2024-43806rustix's `rustix::fs::Dir` iterator with the `linux_raw` backend can cause memory explosionmedium
rand 0.8.5>=0.8.6
GHSA-cq8v-f236-94qcRand is unsound with a custom logger using rand::rng()low
tokio 1.26.0>=1.51.6
GHSA-rr8g-9fpq-6wmgTokio broadcast channel calls clone in parallel, but does not require `Sync`low
RUSTSEC-2026-0386`AsyncFd::new` and related constructors violate I/O safetylow
proc-macro-error 1.0.4 buildnone published
RUSTSEC-2024-0370proc-macro-error is unmaintainedinfo

Dependencies

150
Dependencies150Build behaviour
base640.13.1
bitflags1.3.2
bitflags2.0.2
bytes1.4.0
cfg-if1.0.0
clap4.1.11
clap_lex0.3.3
confy0.5.1
console0.15.5
crossterm0.25.0
ct-logs0.8.0
directories4.0.1
dirs-sys0.3.7
dyn-clone1.0.11
eventsource-client0.11.0
fnv1.0.7
futures0.3.27
futures-channel0.3.27build script
futures-core0.3.27build script
futures-executor0.3.27
futures-io0.3.27
futures-sink0.3.27
futures-task0.3.27build script
futures-util0.3.27build script
getrandom0.2.8
h20.3.16
hashbrown0.12.3
http0.2.9
http-body0.4.5
httparse1.8.0build script
hyper0.14.24
hyper-rustls0.22.1
hyper-timeout0.4.1
indexmap1.9.2build script
inquire0.6.0
io-lifetimes1.0.9build script
is-terminal0.4.5
itoa1.0.6
lazy_static1.4.0
ld-linux-x86-64.so.2system library
libc0.2.140build script
libc.so.6system library
libgcc_s.so.1system library
libm.so.6system library
libmvec.so.1system library
linux-raw-sys0.1.4
lock_api0.4.9build script
log0.4.17build script
memchr2.5.0build script
mio0.8.6
newline-converter0.2.2
num_cpus1.15.0
once_cell1.17.1
openssl-probe0.1.5
os_str_bytes6.5.0
parking_lot0.12.1
parking_lot_core0.9.7build script
pin-project1.0.12
pin-project-lite0.2.9
pin-utils0.1.0
ppv-lite860.2.17
rand0.8.5
rand_chacha0.3.1
rand_core0.6.4
ring0.16.20build scriptprebuilt objects
rustix0.36.11build scriptprebuilt objects
rustls0.19.1
rustls-native-certs0.5.0
ryu1.0.13
scopeguard1.1.0
sct0.6.1
serde1.0.154build script
serde_json1.0.94build script
signal-hook0.3.15build script
signal-hook-mio0.2.3
signal-hook-registry1.4.1
slab0.4.8build script
smallvec1.10.0
socket20.4.9
spin0.5.2
strsim0.10.0
termcolor1.2.0
thiserror1.0.39build script
tokio1.26.0build script
tokio-io-timeout1.2.0
tokio-rustls0.22.0
tokio-util0.7.7
toml0.5.11
tower-service0.3.2
tracing0.1.37
tracing-core0.1.30
try-lock0.2.4
unicode-segmentation1.10.1
unicode-width0.1.10
untrusted0.7.1
want0.3.0
webpki0.21.4
httpdate1.0.2
autocfg1.1.0
bumpalo3.12.0
cc1.0.79
clap_derive4.1.9proc macro
core-foundation0.9.3
core-foundation-sys0.8.3build script, not run
crossterm_winapi0.9.0
encode_unicode0.3.6
errno0.2.8
errno-dragonfly0.1.2build script, not run
futures-macro0.3.27proc macro
heck0.4.1
hermit-abi0.2.6
hermit-abi0.3.1
js-sys0.3.61
pin-project-internal1.0.12proc macro
proc-macro-error1.0.4build script
proc-macro-error-attr1.0.4build scriptproc macro
proc-macro21.0.51build script
quote1.0.23build script
redox_syscall0.2.16
redox_users0.4.3
schannel0.1.21
security-framework2.8.2
security-framework-sys2.8.0
serde_derive1.0.154build scriptproc macro
syn1.0.109build script
thiserror-impl1.0.39proc macro
tokio-macros1.8.2proc macro
unicode-ident1.0.8
version_check0.9.4
wasi0.11.0+wasi-snapshot-preview1
wasm-bindgen0.2.84build script, not run
wasm-bindgen-backend0.2.84
wasm-bindgen-macro0.2.84proc macro
wasm-bindgen-macro-support0.2.84
wasm-bindgen-shared0.2.84build script, not run
web-sys0.3.61
winapi0.3.9build script, not run
winapi-i686-pc-windows-gnu0.4.0build script, not runprebuilt objects
winapi-util0.1.5
winapi-x86_64-pc-windows-gnu0.4.0build script, not runprebuilt objects
windows-sys0.42.0
windows-sys0.45.0
windows-targets0.42.1
windows_aarch64_gnullvm0.42.1build script, not runprebuilt objects
windows_aarch64_msvc0.42.1build script, not runprebuilt objects
windows_i686_gnu0.42.1build script, not runprebuilt objects
windows_i686_msvc0.42.1build script, not runprebuilt objects
windows_x86_64_gnu0.42.1build script, not runprebuilt objects
windows_x86_64_gnullvm0.42.1build script, not runprebuilt objects
windows_x86_64_msvc0.42.1build script, not runprebuilt objects

Versions2

Raw data

capture
452 KB
records
62,480
bytes per record
7.2

Loading a sample of the capture

Want to see more? E-mail us at hello@bitbison.io about your use case.

1 of 1 jobs captured: build-test success · Generated 2026-11-02 · run e766db36-5fab-4978-918c-4f51a3147e4c

analysis 0.1.0 · 2026-11-02 · 124b10e · graph v2

koios 0.1.1 compiles the OpenAI API key into the koi binary when one is set at install

secrets-exposureCovers 0.1.1Reviewed by BitbisonUpdated 2026-11-04

koi takes its OpenAI key from a flag, its config file or a prompt, but it checks OPENAI_API_KEY with option_env!, which reads the variable when the crate is compiled: a key exported during `cargo install koios` is written into the binary and used from then on.

What the package does

koios installs koi, a terminal chat client for OpenAI's API that can propose shell commands and run them after the user confirms each one. It looks for the API key in four places: the --api-key flag, the OPENAI_API_KEY variable, its config file, and finally an interactive prompt.

The environment check happens at compile time, not at startup. If OPENAI_API_KEY is set when koios is compiled, as it is for many users who keep it exported and run cargo install koios, the key is written into the koi executable as a plain string. From then on koi uses that compiled-in key unless a flag overrides it, ignores a later change of the variable, and gives the key to anyone with a copy of the binary. If the variable is unset at compile time, koi falls back to its config file and the prompt, and no key is compiled in.

What the code does

  • src/config.rs:31-33: if let Some(api_key) = option_env!("OPENAI_API_KEY") { return api_key.to_string(); }. option_env! is evaluated by the compiler: it yields the variable's value at compile time, or None, and the result is a constant in the program.
  • src/config.rs:27-29, 35-40 and 43: the flag, the config file loaded with confy, and the password prompt, which are read at runtime.
  • src/config.rs:42: the error message names "env (OPENAI_API_KEY)" as a source, which reads as a runtime setting.
  • src/commands.rs:44-60 and 97-98: each command the model proposes is shown with a choice to run, edit or skip it, and only a chosen command is passed to sh -c.

Conclusion

secrets-exposure: koios compiles an OPENAI_API_KEY present at install time into the koi binary, where every copy of that binary carries it and the variable can no longer change it.

Install koios with the variable unset (env -u OPENAI_API_KEY cargo install koios) and give the key through the flag or the config file. If a koi binary compiled with a key has been copied elsewhere, revoke that key. 0.1.1 is the only release that is not yanked.

Indicators

environment
OPENAI_API_KEY
files
koi

Examined

0.1.1
sha256:b10406ff35a72d5b1f17b1be050c6c71f77d5604ef2757382e35f307101578fe

Links