GitHub Security Advisory: GHSA-xxpw-32hf-q8v9
Package: wwbn/avideo (COMPOSER)
Severity: HIGH (CVSS 8.1)
CWE: CWE-287: Improper Authentication, CWE-668: Exposure of Resource to Wrong Sphere
Vulnerable versions: <= 21.0
Patched in: unpatched

Summary: AVideo: Unauthenticated PHP session store exposed to host network via published memcached port

Details:
## Summary
The official `docker-compose.yml` publishes the memcached service on host port 11211 (`0.0.0.0:11211`) with no authentication, while the Dockerfile configures PHP to store all user sessions in that memcached instance. An attacker who can reach port 11211 can read, modify, or flush session data — enabling session hijacking, admin impersonation, and mass session destruction without any application-level authentication.

## Severity
**High** (CVSS 3.1: 8.1)

`CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H`

- **Attack Vector:** Network — `docker-compose.yml` binds memcached to `0.0.0.0:11211` on the host
- **Attack Complexity:** High — exploitation requires port 11211 to be network-reachable, which depends on external firewall/security group configuration beyond the attacker's control
- **Privileges Required:** None — memcached has no authentication mechanism enabled
- **User Interaction:** None
- **Scope:** Unchanged — impact is to the AVideo application's session management
- **Confidentiality Impact:** High — session data includes user IDs, admin flags, email addresses, and password hashes
- **Integrity Impact:** High — an attacker can modify session data to inject admin privileges or impersonate any user
- **Availability Impact:** High — `flush_all` destroys all active sessions, forcing mass logout

## Affected Component
- `docker-compose.yml` — memcached service `ports` directive (line 203)
- `Dockerfile` — PHP session configuration (lines 150-151)

## CWE
- **CWE-668**: Exposure of Resource to Wrong Sphere
- **CWE-287**: Improper Authentication (memcached has no authentication)

## Description

### Memcached port unnecessarily published to host network

The `docker-compose.yml` publishes the memcached port to the Docker host's network interface:

```yaml
# docker-compose.yml — lines 192-213
  memcached:
    image: memcached:alpine
    restart: unless-stopped
    command: >
      memcached -m 512 -c 2048 -t ${NPROC:-4} -R 200
    ports:
      - "${MEMCACHE_PORT:-11211}:11211"    # <-- Exposes to 0.0.0.0:11211
    networks:
      - app_net
```

The memcached command has no authentication flags:
- No `-S` flag (SASL authentication)
- No `-l 127.0.0.1` flag (interface binding restriction)

The default `env.example` reinforces this port:
```
MEMCACHE_PORT=11211
```

### PHP sessions stored entirely in memcached

The Dockerfile configures PHP to use memcached as the session store:

```ini
; Dockerfile — lines 150-151
session.save_handler           = memcached
session.save_path              = "memcached:11211?persistent=1&timeout=2&retry_interval=5"
```

### Session data contains all authentication state

The application stores complete authentication state in sessions. From `objects/user.php`:

```php
// user.php:1521 — login check
$isLogged = !empty($_SESSION['user']['id']);

// user.php:1544 — admin check
return !empty($_SESSION['user']['isAdmin']);
```

Session data includes: user ID, email, username, password hash, admin flag, channel n