Skip to content
Open-Source Registry

cargo / uai

uai 0.1.0

bitbison: flagged, behavior flagged, dependencies flagged, posture not checked, pipeline clean, 1 of 1 jobs captured RiskhighVulnshigh
processes
246
operations
28K
packages
124
compiler runs
75
connections
1
build time
26s
job time
26s
capture
377 KB
records
51K
bytes / record
7.4

A plugabble command-line interface for OpenAI API

1,646 downloads · published 2023-03-30 View on crates.io
Reviewed by Bitbison: secrets-exposureuai reads OPENAI_API_KEY when it is compiled, not when it starts: the key in the compiling environment becomes a string inside the uai binary, and anyone with a copy of that binary has the key.

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
  • uai contains OPENAI_API_KEY
    uai
    high
  • OPENAI_API_KEY copied into uai-8aa47a0dd2ed82c1
    uai-8aa47a0dd2ed82c1
    low

Detection

highwitnessed

uai contains OPENAI_API_KEY

Credential copied by the build

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

Evidence

  1. Credentials found in a file the build wrotecause

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

    subject /home/runner/work/uai/uai/target/release/uai

  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

OPENAI_API_KEY copied into uai-8aa47a0dd2ed82c1

Credential copied by the build

Subject
/home/runner/work/uai/uai/target/release/deps/uai-8aa47a0dd2ed82c1
Reaches
uai-8aa47a0dd2ed82c1member
Jobs
build-test
Rule
credential-copied · uai

Evidence

  1. Credentials found in a file the build wrotecause

    OPENAI_API_KEY in /home/runner/work/uai/uai/target/release/deps/uai-8aa47a0dd2ed82c1, written by rust-lld

    subject /home/runner/work/uai/uai/target/release/deps/uai-8aa47a0dd2ed82c1

    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…

  2. Why it matterscontext

    Credentials were exposed in this file.

In uai

Loading the graph

Processes

build-test

cargo›cargo›rustc›…›ld.lld›rust-lld

Ran
/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…
Invoked by
cargo build --release --locked --message-format=json-render-diagnostics
Lineage · 7 processes
  1. cargocargo build --release --locked --message-format=json-render-diagnostics2561
  2. cargo/home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/cargo build --release --locked --message-format=json-render-diagnostics2561
  3. rustc/home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/bin/rustc --crate-name uai --edition=2021 src/main.rs --error-format=json --json=diagnostic-rend…4264
  4. cccc -m64 /home/runner/work/uai/uai/target/release/deps/rustcY955FM/symbols.o /home/runner/work/uai/uai/target/release/deps/uai-8aa47a0dd2ed82c1.uai.b289cb5bf7da2…4265
  5. collect2/usr/libexec/gcc/x86_64-linux-gnu/15/collect2 -plugin /usr/libexec/gcc/x86_64-linux-gnu/15/liblto_plugin.so -plugin-opt=/usr/libexec/gcc/x86_64-linux-gnu/15/lto…4266
  6. ld.lld/home/runner/.rustup/toolchains/1.99.0-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld.lld -plugin /usr/libexec/gcc/x86_64-linux-gnu…4267
  7. rust-lld/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…4267

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 (uai) via crates.io · 11,477 files · went into an output ecosystem
Vulnerabilities23FixSeverity
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
openssl 0.10.48>=0.10.79
CVE-2026-41676rust-openssl: Deriver::derive and PkeyCtxRef::derive can overflow short buffers on OpenSSL 1.1.1high
CVE-2026-41678rust-openssl has incorrect bounds assertion in aes key wraphigh
CVE-2026-41681rust-openssl: rustMdCtxRef::digest_final() writes past caller buffer with no length checkhigh
CVE-2026-41898rust-openssl: Unchecked callback length in PSK/cookie trampolines leaks adjacent memory to peerhigh
CVE-2026-42327rust-openssl has undefined behavior in X509Ref::ocsp_responders for certificates with non-UTF-8 OCSP URLshigh
CVE-2023-53159`openssl` `X509VerifyParamRef::set_host` buffer over-readmedium
CVE-2025-24898rust-openssl ssl::select_next_proto use after freemedium
CVE-2026-44662rust-openssl vulnerable to heap buffer overflow when encrypting with AES key-wrap-with-paddingmedium
GHSA-4fcv-w3qc-ppggrust-openssl Use-After-Free in `Md::fetch` and `Cipher::fetch`medium
GHSA-q445-7m23-qrmwopenssl's `MemBio::get_buf` has undefined behavior with empty buffersmedium
GHSA-xphf-cx8h-7q9g`openssl` `X509StoreRef::objects` is unsoundmedium
CVE-2026-41677rust-opennssl has an Out-of-bounds read in PEM password callback when returning an oversized lengthlow
bytes 1.4.0>=1.11.1
CVE-2026-25541bytes has integer overflow in BytesMut::reservemedium
idna 0.3.0>=1.0.0
CVE-2024-12224`idna` accepts Punycode labels that do not produce any non-ASCII when decodedmedium
rustix 0.36.11>=0.36.16
CVE-2024-43806rustix's `rustix::fs::Dir` iterator with the `linux_raw` backend can cause memory explosionmedium
tokio 1.27.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
instant 0.1.12none published
RUSTSEC-2024-0384`instant` is unmaintainedinfo

Dependencies

127
Dependencies127Build behaviour
base640.21.0
bitflags1.3.2
bytes1.4.0
cfg-if1.0.0
encoding_rs0.8.32
fnv1.0.7
foreign-types0.3.2
foreign-types-shared0.1.1
form_urlencoded1.1.0
futures-channel0.3.27build script
futures-core0.3.27build script
futures-sink0.3.27
futures-task0.3.27build script
futures-util0.3.27build script
h20.3.16
hashbrown0.12.3
http0.2.9
http-body0.4.5
httparse1.8.0build script
hyper0.14.25
hyper-tls0.5.0
idna0.3.0
indexmap1.9.3build script
ipnet2.7.2
itoa1.0.6
ld-linux-x86-64.so.2system library
libc0.2.140build script
libc.so.6system library
libcrypto.so.3system library
libgcc_s.so.1system library
libm.so.6system library
libmvec.so.1system library
libssl.so.3system library
lock_api0.4.9build script
log0.4.17build script
mime0.3.17
mio0.8.6
native-tls0.2.11build script
num_cpus1.15.0
once_cell1.17.1
openssl0.10.48build script
openssl-probe0.1.5
openssl-sys0.9.83build script
parking_lot0.12.1
parking_lot_core0.9.7build script
percent-encoding2.2.0
pin-project-lite0.2.9
pin-utils0.1.0
reqwest0.11.16
ryu1.0.13
scopeguard1.1.0
serde1.0.159build script
serde_json1.0.95build script
serde_urlencoded0.7.1
signal-hook-registry1.4.1
slab0.4.8build script
smallvec1.10.0
socket20.4.9
tinyvec1.6.0
tinyvec_macros0.1.1
tokio1.27.0build script
tokio-native-tls0.3.1
tokio-util0.7.7
tower-service0.3.2
tracing0.1.37
tracing-core0.1.30
try-lock0.2.4
unicode-bidi0.3.13
unicode-normalization0.1.22
url2.3.1
want0.3.0
httpdate1.0.2
autocfg1.1.0
bumpalo3.12.0
cc1.0.79
const_env0.1.2proc macro
const_env_impl0.1.2
core-foundation0.9.3
core-foundation-sys0.8.3build script, not run
errno0.2.8
errno-dragonfly0.1.2build script, not run
fastrand1.9.0
hermit-abi0.2.6
hermit-abi0.3.1
instant0.1.12
io-lifetimes1.0.9build script, not run
js-sys0.3.61
lazy_static1.4.0
linux-raw-sys0.1.4
openssl-macros0.1.0proc macro
pkg-config0.3.26
proc-macro21.0.54build script
quote1.0.26build script
redox_syscall0.2.16
rustix0.36.11build script, not runprebuilt objects
schannel0.1.21
security-framework2.8.2
security-framework-sys2.8.0
serde_derive1.0.159build scriptproc macro
syn1.0.109build script
syn2.0.11
tempfile3.4.0
tokio-macros2.0.0proc macro
unicode-ident1.0.8
vcpkg0.2.15prebuilt objects
wasi0.11.0+wasi-snapshot-preview1
wasm-bindgen0.2.84build script, not run
wasm-bindgen-backend0.2.84
wasm-bindgen-futures0.4.34
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-x86_64-pc-windows-gnu0.4.0build script, not runprebuilt objects
windows-sys0.42.0
windows-sys0.45.0
windows-targets0.42.2
windows_aarch64_gnullvm0.42.2build script, not runprebuilt objects
windows_aarch64_msvc0.42.2build script, not runprebuilt objects
windows_i686_gnu0.42.2build script, not runprebuilt objects
windows_i686_msvc0.42.2build script, not runprebuilt objects
windows_x86_64_gnu0.42.2build script, not runprebuilt objects
windows_x86_64_gnullvm0.42.2build script, not runprebuilt objects
windows_x86_64_msvc0.42.2build script, not runprebuilt objects
winreg0.10.1build script, not run

Versions1

Raw data

capture
377 KB
records
50,688
bytes per record
7.4

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-03 · run 277e9064-d902-45f4-9c7e-97fd2892b2ea

analysis 0.1.0 · 2026-11-02 · 3bf4062 · graph v2

uai 0.1.0 compiles the OpenAI API key into its binary

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

uai reads OPENAI_API_KEY when it is compiled, not when it starts: the key in the compiling environment becomes a string inside the uai binary, and anyone with a copy of that binary has the key.

What the package does

uai is a command-line client for OpenAI's completions API. Its README tells users to add OPENAI_API_KEY to their environment. The crate reads that variable when it is compiled, not when it starts: whatever value is set at compile time is written into the uai executable as a plain string, and the program never reads the environment for it afterwards.

Anyone who compiles uai with a key set, through cargo install uai, make install or on a CI runner, ends up with that key inside the binary. Copying the binary to another machine, publishing it as a release, or putting it in a container image hands the key to whoever receives it; strings on the file shows it. A binary compiled without the variable carries an empty key and cannot authenticate, whatever the environment holds when it starts.

What the code does

  • src/openai.rs:10-11: #[from_env] const OPENAI_API_KEY: &'static str = "";. The from_env attribute of the const_env crate replaces the constant's value with the environment variable of the same name at compile time.
  • src/openai.rs:12-13: the same attribute on OPENAI_URL, the endpoint the key is sent to, so an OPENAI_URL set at compile time also changes where the key goes.
  • src/openai.rs:20-24 and 26-31: OpenAIClient::new copies the constant, and prompt sends it as Authorization: Bearer <key> to OPENAI_URL.
  • Nothing in src/ reads OPENAI_API_KEY with std::env::var; the only runtime environment read is HOME, in src/history.rs:23.

The README's "Add a OPENAI_API_KEY to your environment" reads as a runtime setting, and nothing says the key is compiled in.

Conclusion

secrets-exposure: uai bakes the compiling environment's OpenAI API key into its executable, so every copy of a binary compiled with a key leaks it.

Do not distribute a uai binary compiled with a real key. If one has left the machine that compiled it, revoke that key. A client that reads the key with std::env::var at startup avoids the problem.

Indicators

environment
OPENAI_API_KEYOPENAI_URL
symbols
const_env::from_env

Examined

0.1.0
sha256:fcedd3d6623fa51f9567feb67713b44c246a7504008eacb4237bdf647ef903ba

Links