stata-cli is a local command-line tool that runs Stata code, .do files,
and .dta data by loading Stata's own shared library (libstata-mp.dylib)
into the CLI process. It supports Stata 18 and 19 (including StataNow) on
macOS (arm64) and Windows (x86-64), with prebuilt binaries shipped in the
stata-cli.skill package under skill/stata-cli/bin/.
In scope: the Rust CLI (rust-cli/), the skill package (skill/), and the CI
workflows that build, sign, and publish the binaries. The Stata application
itself is a commercial third-party product and is out of scope.
- The CLI runs locally on the user's machine; it is not network-facing and serves no remote requests.
- Attacker-controlled inputs include Stata code and
.dofiles executed viastata-cli run/stata-cli file,.dtafiles read bystata-cli data, and CLI arguments (paths, working directories, session IDs). - Executing user-supplied Stata code is the tool's purpose: the in-process engine is not a sandbox, and code runs with the privileges of the invoking user. The CLI must never widen that boundary (for example by fetching and executing remote code implicitly).
- GitHub tokens and CI credentials are handled by GitHub Actions and must never be committed, logged, or embedded in binaries or documentation.
- All
unsafecode is confined torust-cli/src/atom/stata_engine.rs(the StataSO FFI bridge); no other module may useunsafe. - Paths and working directories passed to Stata are quoted/escaped so they cannot inject commands or break out of the intended argument.
- No secrets, tokens, or personal paths are written to logs, config files, or generated artifacts.
- Output capture is bounded (buffer and drain limits) so pathological Stata output cannot exhaust memory.
- Release binaries in
skill/stata-cli/bin/are built by CI from tagged source; macOS builds are ad-hoc signed so the OS accepts them.
- Memory-safety or crash issues in the FFI bridge, path handling, or data
parsing, reachable from untrusted
.dta/.doinput (high). - Command or argument injection via filenames, working directories, or session IDs (high if it enables code execution beyond the intended command).
- Secrets or tokens leaked through logs, CI artifacts, or release assets (high).
- Supply chain: vulnerable Rust dependencies, tampered binaries in the skill package, or CI configuration that could publish untrusted artifacts (medium-high).
- Engine crashes caused by unusual-but-valid data are expected behavior of the embedded third-party Stata engine, not a CLI defect.
- The Stata application, its license, and its DRM.
- Execution of user-supplied Stata code by design; report only boundary violations (for example, code running beyond what the user asked for).
- Non-security bugs and performance issues.
- The engine runs in-process, so a Stata engine crash can take down the CLI; parallel sessions run as separate OS processes.
- CI cannot run a licensed Stata, so Stata-dependent tests are skipped there and run locally instead.
- The Windows binary is cross-compiled on macOS CI (zigbuild) and smoke-tested but not exercised against a licensed Stata in CI.
Report vulnerabilities privately via GitHub Private Vulnerability Reporting: https://github.com/Utolaris/Stata-CLI/security/advisories/new