lablup / lablup/backend.ai

Mitigate `environ.txt` Container User Info Exposure

Open
#7,445 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

## Overview

**CVE:** CVE-2025-49653
**Issue:** `/home/config/environ.txt` file is readable by container users
**CVSS:** 8.0 (reported) → Actual risk is lower (access_key alone cannot authenticate, but email is PII)
**Reference:** https://hiddenlayer.com/sai_security_advisor/2025-06-backendai

## Problem Statement

The `environ.txt` file exposes sensitive user information to container users, including:

- `BACKENDAI_USER_EMAIL` - **High Risk (PII)**
- `BACKENDAI_ACCESS_KEY` - Medium Risk
- `BACKENDAI_USER_NAME` - Medium Risk
- `BACKENDAI_USER_UUID` - Low Risk

## Recommended Actions

### P0 - Immediate (High Priority)

- Remove `BACKENDAI_USER_EMAIL` from default exposure
- Implement opt-in mechanism at domain/project level if needed

### P1 - Short-term

- Convert `BACKENDAI_ACCESS_KEY` to opt-in
- Convert `BACKENDAI_USER_NAME` to opt-in

### P2 - Long-term

- Convert `BACKENDAI_USER_UUID` to opt-in
- Implement domain/project level configuration for exposed environment variables whitelist
- Establish admin approval process for sensitive information exposure

## Environment Variable Classification Summary

|Category|Count|Action|
|---|---|---|
|Cannot Remove (❌)|20|System essential|
|Remove with Caution (⚠️)|8|May be used by user code|
|Can Remove (✅)|4|Sensitive info, should be opt-in|

## Sub-tasks

1. Research and document removable environment variables
1. Design and implement environment variable template system and storage

## Code Locations

- User info injection: `manager/registry.py:1683-1694`
- CPU core count from image labels: `agent/agent.py:1943-1946`

JIRA Issue: BA-3456

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.