r/Compilers • u/adityazero • 6h ago
Has anyone implemented capability types for a programming language?
A recent news where NEAR AI reported that an attacker exploited a RCE vulnerability in SGLang exposing account details etc.
At this point it seems like we need a better way to program inference systems. As per Claude's research and SGLang's published RCEs this year share a pattern: Python features that run code by design, exposed to the network.
- Pickle over sockets. A ZMQ broker calls pickle.loads() on unauthenticated data, and one scheduler socket binds to 0.0.0.0 by default.
- Malicious model files. A GGUF chat_template can carry a Jinja2 template-injection payload because templates weren't sandboxed, and a torch.load(weights_only=False) fallback unpickles .bin files.
- Weak admin endpoints. LoRA loading allowed unauthenticated RCE through an incomplete pickle denylist, and /server_info returned API keys.
This is where *capability types* can help programmers and tools and AI reason about the attack surfaces. Vx is in early stages so adding capability types is not too difficult at this point but I'd like to learn from someone who has done it before.