Skip to content

Security: GXSZone/Rux

Security

SECURITY.md

Security Policy

English | 简体中文

Supported Versions

Rux is currently in its 0.x initial development phase. Security fixes are provided for the latest 0.1.x release line:

Version Supported
0.1.x Yes
< 0.1.0 No

Reporting a Vulnerability

Please do not report security vulnerabilities through public GitHub Issues, pull requests, or discussions.

Instead, please report suspected security issues privately using GitHub Security Advisories (the Security → Advisories → Report a vulnerability workflow in the repository).

When reporting a vulnerability, please include as much of the following as possible:

  • Affected Rux version, host OS, and target triple (x86_64-windows, x86_64-linux, aarch64-linux, aarch64-macos, or jit)
  • Minimal .rs source reproducer or binary/LSP input triggering the issue
  • Exact CLI invocation (e.g., rux run, rux build, rux lsp) and observed behavior
  • Potential security impact (e.g., arbitrary memory read/write, W^X violation, sandbox/bounds-check bypass, or soundness bug in borrow checking)

Response Expectations

  • Maintainers aim to acknowledge receipt of private advisories promptly, assess severity and scope, and coordinate a fix before public disclosure.
  • Once a patch is available, a security advisory and release note will be published crediting the reporter unless anonymity is requested.

Security Model & Trust Boundaries

Rux is a native systems compiler with several low-level unsafe boundaries that warrant heightened scrutiny:

  1. Host W^X In-Memory JIT (src/emit/jit.rs):
    • Allocates virtual memory pages (VirtualAlloc on Windows, mmap/mprotect on Unix), writes machine code while non-executable, transitions pages to read-execute (RX) before transferring control, and executes compiled code in-process with the same OS privileges as the rux process.
    • Important: rux run executes untrusted code natively without OS sandboxing. Do not run untrusted .rs programs with rux run unless wrapped in an external OS sandbox or container.
  2. Read-Only OS mmap Snapshots (src/core/mmap.rs):
    • .ruxast binary AST snapshots are validated by header magic (RUXAST01), counts, and offsets before reading. Treating externally modified or concurrently truncated snapshot files as trusted input can cause OS SIGBUS/SEH faults; only map snapshots owned by the current workspace or trusted build cache.
  3. Lock-Free Slab Arena (src/core/slab_arena.rs):
    • Relies on atomic chunk initialization and strict WritePhase → ReadPhase transition (seal_for_reading) to preserve memory safety without locks.
  4. Zero-CRT Generated Binaries (src/link/runtime.rs, src/emit/{pe,elf,macho}.rs):
    • Emitted binaries keep .text strictly read-execute (RX) and allocate temporary I/O state on the thread stack (rsp/sp).
    • Read-only byte slices (&[u8]) enforce unsigned bounds checks (cmp idx, len), rejecting negative and out-of-range indices.
  5. LSP Server (src/service/lsp.rs):
    • Designed for local editor stdio transport (Content-Length framed JSON-RPC 2.0) and should not be exposed directly to untrusted network sockets.

There aren't any published security advisories