Containers created by upaas have zero security hardening. User-provided Dockerfiles run with full default Docker capabilities, no seccomp profile, no AppArmor, no resource limits, and RestartPolicyUnlessStopped.
HostConfig{// ... existing fields ...SecurityOpt:[]string{"no-new-privileges"},CapDrop:[]string{"ALL"},Resources:container.Resources{Memory:512*1024*1024,// 512MB default, make configurableNanoCPUs:1000000000,// 1 CPU default, make configurablePidsLimit:int64Ptr(256),},ReadonlyRootfs:false,// apps may need writable fs, but consider per-app config}
Make limits configurable per-app (add columns to apps table for memory_limit, cpu_limit).
Severity
CRITICAL — Without this, any deployed app can DoS the host or attempt container escape.
## Summary
Containers created by upaas have **zero security hardening**. User-provided Dockerfiles run with full default Docker capabilities, no seccomp profile, no AppArmor, no resource limits, and `RestartPolicyUnlessStopped`.
## Location
`internal/docker/client.go` — `CreateContainer()` method (line ~185)
## Impact
This is a **PaaS platform** — users deploy arbitrary code. Without constraints:
1. **Container escape**: Default capabilities include `CAP_SYS_ADMIN` potential via user namespaces, `CAP_NET_RAW` for network attacks
2. **Resource exhaustion / DoS**: No CPU or memory limits means one app can starve all others and the host
3. **Fork bombs / crypto mining**: No process count or resource limits
4. **Network attacks**: `CAP_NET_RAW` allows ARP spoofing, packet sniffing on the Docker network
## Current Code
```go
resp, err := c.docker.ContainerCreate(ctx,
&container.Config{
Image: opts.Image,
Env: envSlice,
Labels: opts.Labels,
ExposedPorts: exposedPorts,
},
&container.HostConfig{
Mounts: mounts,
PortBindings: portBindings,
NetworkMode: container.NetworkMode(opts.Network),
RestartPolicy: container.RestartPolicy{
Name: container.RestartPolicyUnlessStopped,
},
},
...
)
```
## Suggested Fix
Add to `HostConfig`:
```go
HostConfig{
// ... existing fields ...
SecurityOpt: []string{"no-new-privileges"},
CapDrop: []string{"ALL"},
Resources: container.Resources{
Memory: 512 * 1024 * 1024, // 512MB default, make configurable
NanoCPUs: 1000000000, // 1 CPU default, make configurable
PidsLimit: int64Ptr(256),
},
ReadonlyRootfs: false, // apps may need writable fs, but consider per-app config
}
```
Make limits configurable per-app (add columns to apps table for memory_limit, cpu_limit).
## Severity
**CRITICAL** — Without this, any deployed app can DoS the host or attempt container escape.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Containers created by upaas have zero security hardening. User-provided Dockerfiles run with full default Docker capabilities, no seccomp profile, no AppArmor, no resource limits, and
RestartPolicyUnlessStopped.Location
internal/docker/client.go—CreateContainer()method (line ~185)Impact
This is a PaaS platform — users deploy arbitrary code. Without constraints:
CAP_SYS_ADMINpotential via user namespaces,CAP_NET_RAWfor network attacksCAP_NET_RAWallows ARP spoofing, packet sniffing on the Docker networkCurrent Code
Suggested Fix
Add to
HostConfig:Make limits configurable per-app (add columns to apps table for memory_limit, cpu_limit).
Severity
CRITICAL — Without this, any deployed app can DoS the host or attempt container escape.
WONTFIX, working as intended