The Security Philosophy of Ephemeral Systems

In modern computer security, data that does not exist cannot be breached. Traditional file storage repositories accumulate years of forgotten spreadsheets, database dumps, API credentials, and log files. This creates an ever-growing attack surface subject to subpoena, extortion, credential stuffing, and data leaks.

tdrop is architected under the principle of Aggressive Ephemerality. We treat every file as a hot potato: stream it directly to edge storage, verify it for malware, make it available for the exact duration requested by the sender, and incinerate it permanently.

1. Zero-Disk & Zero-RAM Edge Streaming

Most file-sharing applications write incoming HTTP payloads to temporary disk directories (like /tmp) on a monolithic application server before re-uploading them to cloud storage. This introduces serious vulnerabilities:

  • Disk fill attacks (denial of service by exhausting server disk space).
  • Cold remnants left in unallocated disk sectors after unlinking.
  • Server memory dumps containing decrypted file contents.

tdrop utilizes Cloudflare Workers edge nodes that handle requests across 300+ cities globally. Data streams directly from the client's socket into Cloudflare R2 object storage via chunked transfer encoding. At no point is the entire file held in memory or written to persistent server storage.

2. ClamAV Streaming Malware Inspection

To prevent malicious actors from using tdrop as a malware distribution network (C2 staging, payload hosting, or ransomware deployment), all uploads are subjected to automated antivirus inspection powered by the open-source ClamAV heuristic engine:

Incoming HTTP Stream
        │
        ├─────────────────────────────┐
        ▼                             ▼
[Stream to Cloudflare R2]      [Stream to ClamAV Engine]
  (Encrypted Chunk Storage)       (Signature & Heuristic Scan)
                                      │
                                      ▼
                             [Scan Verdict Ready]
                                      │
                   ┌──────────────────┴──────────────────┐
                   ▼                                     ▼
             [CLEAN (100%)]                       [INFECTED]
                   │                                     │
           Confirm Upload & Shortcode           Immediate R2 Abort & Purge
                                                HTTP 403 Forbidden Response

If ClamAV detects a trojan, macro virus, ransomware dropper, or known signature in the stream, the transfer is immediately terminated, the partial object is purged from R2 storage, and the client receives a 403 Forbidden: Malicious payload detected response.

3. Terminal Escape Injection Protection (Anti-ANSI)

When developers use terminal tools, malicious file names can exploit terminal emulators. An attacker can name a file with ANSI escape codes (such as cursor movement sequences, screen clearing codes, or OSC 8 hyperlink sequences) that trick the developer's terminal into executing hidden commands or spoofing credentials.

tdrop implements strict terminal text sanitization in @tdrop/shared:

// Strip ANSI escape codes, cursor repositions, and OSC sequences
export function sanitizeTerminalText(input: string): string {
  return input
    .replace(/\x1B\[[0-?]*[ -/]*[@-~]/g, "") // ANSI CSI commands
    .replace(/\x1B\]8;;.*?(\x1B\\|\x07)/g, "") // OSC 8 hyperlinks
    .replace(/[\r\n\t\x00-\x1F]/g, " "); // Control characters
}

4. Cryptographic Shortcodes & Entropy

File access keys are generated as 7-character Base62 shortcodes (e.g., a7kX9b2):

  • Base62 character set: [0-9a-zA-Z] (62 possible characters).
  • Combinatorial space: $62^7 = 3,521,614,606,208$ possible combinations (3.52 trillion keys).
  • With an average active concurrent file pool under 100,000 items, the probability of an attacker guessing an active shortcode is negligible ($< 0.000003%$).
  • Strict rate limiters block brute-force directory enumeration across all edge nodes.

5. Telemetry Filename Privacy

Our public telemetry stream at /stats provides transparency into network throughput and edge traffic. However, real user file names are never displayed in cleartext. Filenames are automatically masked to drop_••••<token>.<ext>, preserving the file format indicator while fully protecting personal identifiers and confidential filenames.