Skip to content

[SECURITY] gcc available in sandbox image — unnecessary attack surface #807

Closed

Description

@cluster2600

Summary

The base sandbox image includes gcc, which allows the sandbox user to compile arbitrary native code including shared libraries for LD_PRELOAD injection, exploit code, and custom tooling.

Reproduction

$ ssh into sandbox
$ gcc --version
gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
$ echo 'void __attribute__((constructor)) init() { /* arbitrary code */ }' > /tmp/evil.c
$ gcc /tmp/evil.c -shared -o /tmp/evil.so
$ # succeeds

Impact

An agent (or prompt-injected agent) can compile:

  • LD_PRELOAD libraries to intercept libc calls and capture secrets passed through function arguments
  • Custom network tooling to probe internal interfaces
  • Exploit code targeting kernel vulnerabilities

Recommendation

Remove gcc, g++, make, and build-essential from the sandbox image. If compilation is needed for agent workflows (e.g. pip install with native extensions), provide a separate build-enabled image profile rather than including it in the default.

Environment

  • openshell 0.0.14
  • Base sandbox image: ghcr.io/nvidia/openshell-community/sandboxes/base:latest
  • DGX Spark (aarch64)

Activity

  1. cluster2600 commented on Mar 24, 2026

    @cluster2600
    ContributorAuthor

    Related: #796 proposes a command pattern denylist that would provide application-level coverage for this class of issue. Worth addressing together — the image hardening here is the defence-in-depth layer (remove the tool entirely), whilst #796 catches the patterns even if the tool is present via a different path.

  2. wscurran commented on Mar 24, 2026

    @wscurran
    Contributor

    ✨ Thanks for submitting this security issue, it addresses a potential vulnerability in our sandbox image configuration that could be exploited by an attacker to compile malicious code.

  3. added a commit that references this issue on Mar 24, 2026
    9427f6a
  4. BenediktSchackenberg commented on Mar 24, 2026

    @BenediktSchackenberg
    Contributor

    Addressed in #830 — combined PR that removes gcc/g++/make from the runtime image along with other sandbox hardening.

  5. added 2 commits that reference this issue on Mar 25, 2026
    e689f98
    c687483
  6. added a commit that references this issue on Mar 25, 2026
    2e0066f
  7. added a commit that references this issue on Apr 4, 2026
    5316d0b
  8. added theissue type on Jun 8, 2026
  9. added
    area: packaging
    area: security
    platform: container
    on Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: packagingarea: securityplatform: container

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions