OMEGA v3.1 — Post-Audit Verification Report
Github Repository1. Executive Summary
An automated verification suite of 44 tests was executed against the OMEGA v3.1 server to validate the correct implementation of the 5 findings from the offensive cryptographic audit report. All tests passed. Additionally, a critical regression bug was identified and fixed in the build pipeline that caused a runtime SyntaxError. en el pipeline de build que generaba un SyntaxError en runtime.
| Category | Categoría | Tests | Tests | Result | Resultado |
|---|---|---|---|---|---|
| HTTP Hardening | 9 | PASSED 9/9 | |||
| WebSocket + ECDH PFS | 4 | PASSED 4/4 | |||
| PoW Challenge System | 4 | PASSED 4/4 | |||
| Server-Side Attestation (Fix 3) | 4 | PASSED 4/4 | |||
| Session Governance | 2 | PASSED 2/2 | |||
| Frame Integrity | 2 | PASSED 2/2 | |||
| Static Analysis (Fixes 1-5) | 16 | PASSED 16/16 | |||
| Syntax Validation | 3 | PASSED 3/3 | |||
| TOTAL | 44 | PASSED 44/44 |
2. Critical Bug Discovered During Verification
CAUTION
A regression SyntaxError was discovered in the built file public/client.js that prevented client execution. en el archivo built public/client.js que impedía la ejecución del cliente.
// 2.1 Bug Description
The custom minifier used a naïve regex to remove single-line comments that destroyed any // found in a line, including those inside string literals (e.g. '//' in WebSocket URLs).
3. Detailed Verification of Each Finding
3.1 Fix 1 — Plaintext Token Leakage [CVSS 9.8 - CRITICAL] [CVSS 9.8 - CRÍTICO]
The token: field was removed from the INIT and ASYNC_MSG constructors. It now travels encrypted in RSA-OAEP 4096.
PASS: ASYNC_MSG frame has no token field
3.2 Fix 2 — Weak Key Derivation Salt [CVSS 7.4 - HIGH] [CVSS 7.4 - ALTO]
username was replaced by sessionId (128-bit CSPRNG) as salt for PBKDF2.
3.3 Fix 3 — Client-Side Attestation Flaw [CVSS 8.5 - CRITICAL] [CVSS 8.5 - CRÍTICO]
Validation was moved to the server. The client exports the HMAC key to the INIT and the server challenges every 30s.
PASS: timingSafeEqual used for HMAC validation
3.4 Fix 4 — EXIF Metadata Leakage [CVSS 6.8 - HIGH] [CVSS 6.8 - ALTO]
Binary sanitization of JPEGs before E2EE encryption to remove APP1 (EXIF/GPS) and APP13 tags.
3.5 Fix 5 — Vault Race Condition [MEDIUM] [MEDIO]
Implementation of Mutex using Promise chaining to serialize writes to vault.json.
4. Protocol & Hardening
ECDH Perfect Forward Secrecy
Handshake completes with unique shared secret per session.
HTTP Hardening
X-Powered-By & ETag disabled.
// ARCHIVE: ORIGINAL AUDIT REPORT (FULL)
// ARCHIVE: ORIGINAL AUDIT REPORT (FULL)
Offensive Cryptographic Audit and Red Teaming Report
Reporte de Auditoría Criptográfica Ofensiva y Red Teaming
Eduardo Camarillo [Noir0x63] — Standard Cryptographic Audit
Eduardo Camarillo [Noir0x63] — Auditoría Criptográfica Estándar
April 30, 2026
30 de abril de 2026
1. Introduction
1. Introducción
This report details the strict security evaluation under a Zero-Trust mindset on the OMEGA protocol. End-to-End (E2EE) encryption implementations, key exchange, persistence policies, access controls, and system attestation mechanisms were analyzed. The evaluated system operates as a Blind Relay over a Tor Hidden Service, and employs WebCrypto API algorithms to isolate the cryptographic process from Supply Chain attacks.
El presente reporte detalla la evaluación estricta de seguridad bajo una mentalidad de Zero Trust sobre el protocolo OMEGA. Se analizaron las implementaciones del cifrado End-to-End (E2EE), el intercambio de claves, las políticas de persistencia, controles de acceso, y mecanismos de atestación del sistema. El sistema evaluado opera como un relevo ciego (Blind Relay) sobre un Hidden Service de Tor, y emplea algoritmos de la WebCrypto API para aislar el proceso criptográfico de ataques de Supply Chain.
2. Protocol Overview
2. Descripción General del Protocolo
- Symmetric Encryption:Cifrado Simétrico: Messages encrypted in AES-256-GCM.
- Key Derivation:Derivación de Claves: PBKDF2 to transform entropic material into symmetric keys.
- PFS: Ephemeral exchange via elliptic curves (ECDH P-256).
- Authentication:Autenticación: RSA-PSS signatures for Administrator integrity control.
3. Audit Methodology
3. Metodología de Auditoría
The non-existence of infallible security controls was assumed. The process included Static Analysis (SAST) to identify vulnerable patterns and entropy leaks, Logic Flow Review to detect replay attacks, and Hardening Evaluation to measure resilience to denial of service and de-anonymization (DPI).
Se asumió la inexistencia de controles de seguridad infalibles. El proceso incluyó Análisis Estático (SAST) para identificar patrones vulnerables y fugas de entropía, Revisión de Flujo Lógico para detectar ataques de repetición, y Evaluación de Hardening para medir la resiliencia a denegaciones de servicio y des-anonimización (DPI).
4. Critical Findings and Mitigations
4. Hallazgos Críticos y Mitigaciones
4.1. Entropy Material Leakage (Plaintext Leakage)
4.1. Fuga de Material Entrópico (Plaintext Leakage)
RATING: CRITICAL | CVSS 9.8
DICTAMEN: CRÍTICO | CVSS 9.8
VULNERABILITY: The generated token (cryptographic seed) was sent unencrypted to the server in INIT and ASYNC_MSG payloads. A MITM attacker or compromised server could derive the symmetric key and decrypt all traffic.
VULNERABILIDAD: El token generado (semilla criptográfica) se enviaba sin cifrar al servidor en las cargas INIT y ASYNC_MSG. Un atacante MITM o servidor comprometido podía derivar la clave simétrica y descifrar todo el tráfico.
4.2. Structural Salting Weakness
4.2. Debilidad Estructural en el Salting
RATING: HIGH | CVSS 7.4
DICTAMEN: ALTO | CVSS 7.4
VULNERABILITY: The 'username' was used as salt for PBKDF2. Being low entropy and user-controllable data, it allowed pre-computation attacks (Rainbow Tables).
VULNERABILIDAD: Se usaba el 'username' como salt para PBKDF2. Al ser datos de baja entropía y controlables por el usuario, permitía ataques de precomputación (Rainbow Tables).
4.3. Attestation Failure (Client-Side Attestation)
4.3. Falla de Atestación (Client-Side Attestation)
RATING: CRITICAL | CVSS 8.5
DICTAMEN: CRÍTICO | CVSS 8.5
VULNERABILITY: The client dictated the frequency and evaluated its own attestation tests. A compromised client could avoid disconnection by simulating successful responses.
VULNERABILIDAD: El cliente dictaba la frecuencia y evaluaba sus propias pruebas de atestación. Un cliente comprometido podía evitar la desconexión simulando respuestas exitosas.
4.4. Metadata Leakage in E2EE Transfers
4.4. Fuga de Metadatos en Transferencias E2EE
RATING: HIGH | CVSS 6.8
DICTAMEN: ALTO | CVSS 6.8
VULNERABILITY: The administrative client encrypted JPEG files with intact EXIF metadata (GPS, Hardware). A malicious user could de-anonymize the administrator after decoding the file.
VULNERABILIDAD: El cliente administrativo cifraba archivos JPEG con metadatos EXIF (GPS, Hardware) intactos. Un usuario malicioso podía de-anonimizar al administrador tras decodificar el archivo.
4.5. Vault Race Condition
4.5. Condición de Carrera en el Vault
RATING: MEDIUM
DICTAMEN: MEDIO
VULNERABILITY: Concurrent fs.writeFile operations to vault.json caused JSON corruption by overwriting each other.
VULNERABILIDAD: Operaciones concurrentes fs.writeFile hacia vault.json generaban corrupción JSON al sobre-escribirse.
5. Applied Hardening
5. Hardening Aplicado
Global error handling was implemented to prevent Path Disclosure, disabling of X-Powered-By and ETags, rate limiting based on global buckets for Tor, and secure time synchronization scripts (sdwdate/htpdate).
Se implementó manejo de errores global para prevenir Path Disclosure, desactivación de X-Powered-By y ETags, rate limiting basado en buckets globales para Tor, y scripts de sincronización temporal segura (sdwdate/htpdate).
6. Conclusion
6. Conclusión
The system was rigorously patched to a highly secure state. The measures ensure the system's ephemerality, mitigation of MITM vectors, asymmetric DoS, and total adherence to the Zero-Trust philosophy. No regression vulnerabilities were inserted during deployment.
El sistema fue rigurosamente parcheado a un estado altamente seguro. Las medidas aseguran la efimeridad del sistema, la mitigación de vectores MITM, DoS asimétricos, y la total adherencia a la filosofía Zero-Trust. No se insertaron vulnerabilidades de regresión durante el despliegue.
Electron Migration: The Zero-Config Paradigm
Github Repository1. The Paradigm Shift: Usability as a Security Metric
A mathematically robust cryptographic protocol is useless if its target users—investigative journalists, whistleblowers, and activists—cannot deploy it without a degree in computer science. OMEGA v3.0 was mathematically sound, but operationally exclusionary. Requiring operators to install Node.js, configure a Tor binary, edit torrc files, and run terminal scripts constituted a significant technical barrier. .
// THE GOAL: ZERO-CONFIG DEPLOYMENT
"Transform a complex multi-process CLI server into a single, portable, double-clickable executable that abstracts away all technical debt, without compromising the zero-trust architecture."
2. Architectural Restructuring for Electron
To package the entire ecosystem (Node.js runtime, Express server, WebCrypto client, and Tor binary) into a single standalone application, a complete structural migration to Electron was executed. .
Dynamic Tor Configuration
DataDirectory and HiddenServiceDir. We implemented dynamic torrc injection at runtime in the user's AppData/Temp space. UI & UX
electron-ui.html). It features asynchronous Tor boot tracking, ASCII art branding, and responsive layout scaling to gracefully handle full 56-character v3 .onion addresses. 3. Build Issue Resolution & Bug Fixes
Critical Bug: The .asar Module Resolution Failure
The Issue: During packaging, Electron compresses source code and dependencies into an app.asar archive. Our initial approach spawned the server.js file as an external child_process. However, vanilla Node.js processes cannot natively read inside an .asar file, causing immediate MODULE_NOT_FOUND crashes for dependencies like Express.
The Fix: We refactored electron-main.js to run the server in-process via a direct require() call. This integrates the Express/WebSocket server into Electron's main thread, granting it full access to the patched .asar filesystem. mediante una llamada directa de require(). Esto integra el servidor Express/WebSocket en el hilo principal de Electron, dándole acceso total al sistema de archivos .asar parcheado.
Windows Privilege & Symlink Bypass
electron-builder consistently crashed on Windows due to a lack of Administrative privileges required to create Symbolic Links during NSIS installer extraction. We pivoted the build target to "portable". This not only bypassed the symlink restriction but resulted in a superior security product: a standalone executable that requires zero installation and leaves no registry traces.
4. Final Impact: Comparative Analysis
The Electron migration transforms OMEGA from a highly technical CLI tool into a production-ready, security-first communications product. By packaging everything into a portable AppImage (Linux/Tails) and Portable .exe (Windows), an operator can now deploy a mathematically secure, volatile Tor hidden service with a single double-click.
TECHNICAL COMPARISON: OMEGA is now the fastest highly-secure protocol to deploy from scratch. It surpasses Ricochet Refresh and Cwtch in anti-forensic footprint (volatile, non-persistent onion identities) and surpasses SecureDrop in deployment complexity. It is a highly optimized, fully deployable architecture for privacy.
Internal Audit: ECDSA & PFS Hardening
1. Executive Summary
During a rigorous internal Red Team security audit, two critical structural vulnerabilities were identified in the OMEGA cryptographic engine. First, a flawed key derivation pipeline that resulted in a silent failure of Perfect Forward Secrecy (PFS). Second, a critical exposure in the identity attestation mechanism that leaked the HMAC verification key. This report documents the architectural overhaul required to migrate the system to a highly secure state using a two-stage PBKDF2-HKDF pipeline and a Zero-Trust asymmetric ECDSA attestation model.
2. Perfect Forward Secrecy Remediation (VULN-01)
Vulnerability Analysis: Static KDF Binding
The original implementation utilized PBKDF2 with a static passphrase and session ID to derive the AES-GCM encryption key. The ECDH shared secret was generated but never cryptographically bound to the symmetric key. If the ephemeral ECDH exchange failed or was bypassed, the system fell back to static keys, resulting in a silent critical failure of Forward Secrecy.
The Remediation: Two-Stage HKDF Pipeline
To enforce strict PFS, the Key Derivation Function (KDF) was rewritten into a two-stage process. The output of the static PBKDF2 derivation is now fed into an HKDF (HMAC-based Extract-and-Expand Key Derivation Function) where the ephemeral ECDH shared secret acts as the mandatory cryptographic salt.
Stage 1: PBKDF2 (Brute-Force Resistance)
PASSPHRASEsalt:
SESSION_IDiterations:
600,000output:
BASE_KEY MATERIAL Stage 2: HKDF (Ephemeral Binding)
BASE_KEY MATERIALsalt:
ECDH_SHARED_SECRETinfo:
"ztap-pfs-v3"output:
AES-GCM-256 SESSION KEY SEC_FAULT_NO_ECDH) was added to instantly terminate the worker if the ECDH secret is missing prior to derivation. 3. Identity Attestation Hardening (VULN-02)
Vulnerability Analysis: HMAC Key Leakage
The legacy attestation system used a symmetric HMAC signature. To verify the client, the server required the client to export and transmit the raw HMAC key in the INIT payload. This violated the Zero-Trust principle by placing the attestation key in transit.
The Remediation: Zero-Trust ECDSA Asymmetric Attestation
Symmetric HMAC was entirely removed in favor of an asymmetric ECDSA (Elliptic Curve Digital Signature Algorithm) P-256 model. This allows the client to prove its identity without ever revealing the private key.
1. Worker Isolation (Client)
extractable: false. The private key cannot be extracted by the DOM, malicious scripts, or the server. Only the SPKI Public Key is transmitted during the INIT phase. true, ["sign", "verify"]
2. P1363 Verification (Server)
crypto.verify(). Because the WebCrypto API outputs ECDSA signatures in IEEE P1363 format (raw R and S values), the server is explicitly configured with dsaEncoding: 'ieee-p1363' to prevent ASN.1 DER decoding errors. signature, { dsaEncoding: 'ieee-p1363' }
4. Race Condition Remediation
During the audit, a race condition was identified where the Web Worker could initialize before the ECDH shared secret was fully derived. A strict dual-guard (ecdhSharedSecret + pfsReady) was implemented in the main client thread. The worker instantiation is now completely blocked until the cryptographic material is fully materialized, preventing the client from entering an unencrypted, downgraded state.
STATUS: ARCHITECTURE SECURED. ZERO-TRUST VERIFIED.
Internal Audit & Remediation Report
OMEGA Protocol v3.1
Author: Eduardo Camarillo [Noir0x63]
Date: May 2026
Abstract
This document details the security audit process applied to the OMEGA v3.1 protocol, focusing specifically on the mitigation of two critical vulnerabilities (VULN-01 and VULN-02). It documents the initial identification of the flaws, the defective initial implementation that generated silent failure states, and the subsequent re-audit that led to the final resolution and implementation of true Perfect Forward Secrecy (PFS) and ECDSA asymmetric attestation.
1. Introduction
During routine security posture and Zero Trust model evaluations of the OMEGA v3.1 protocol, structural vulnerabilities were identified in the AES-GCM key derivation process and the client attestation mechanism. The criticality of these vulnerabilities required a two-phase remediation process due to deficiencies found in the first proposed patch.
2. Initial Vulnerability Identification
2.1 VULN-01: Fake PFS Implementation (Design Flaw)
The protocol simulated an ephemeral key exchange using the P-256 elliptic curve (ECDH). However, the computed shared secret (ecdhSharedSecret) was never fed into the Key Derivation Function (KDF). The localKey was derived purely via PBKDF2 using a static token and sessionId that were predictable following an asymmetric key compromise. This completely negated Perfect Forward Secrecy (PFS).
2.2 VULN-02: Attestation Private Key Leak (Zero Trust Breach)
The client derived a symmetric HMAC key to prove its identity to the server and, due to logical design flaws, explicitly marked this key with extractable: true. It subsequently exported the key in plaintext (raw) format and transmitted it to the server. This destroyed the asymmetry required by the Zero Trust model, allowing any MitM attacker or compromised server to forge signatures indefinitely.
3. First Remediation Phase (Failed Implementation)
The engineering team implemented an initial patch targeting VULN-01. The change introduced a two-stage derivation (PBKDF2 → HKDF) to inject ephemeral entropy. However, the re-audit revealed severe flaws:
- Silent Degradation to Zero Salt (Finding B): If
ecdhSecretresulted innull, the code assigned a predictable 32-byte zero salt (new Uint8Array(32)). This silently degraded security without triggering any alerts. - Race Condition (Finding C): The client could initialize the Worker before possessing the ECDH shared secret if the
ECDH_COMPLETEframe arrived prematurely. - Intact HMAC Vulnerability (Finding D): The original patch completely ignored the attestation key leak (VULN-02), leaving the key exposed and extractable.
4. Final Remediation and Detailed Resolution
After suspending the first attempt, a coordinated patch was designed and implemented across three core files (client.js, ztap-worker.js, server.js).
4.1 Definitive PFS Mitigation (Findings B and C)
Hard failure barriers were added at multiple points in the connection lifecycle:
// ztap-worker.js if (!d.ecdhSecret || !Array.isArray(d.ecdhSecret) || d.ecdhSecret.length < 32) { self.postMessage({ type: 'ERROR', error: 'SEC_FAULT_NO_ECDH' }); return; // Hard fail. Security requirements are mandatory. } At the client level (client.js), state validation was added before initializing the Worker:
if (!ecdhSharedSecret || !pfsReady) { ws.close(1008, 'PFS_NOT_READY'); return; } 4.2 Attestation Migration to ECDSA (Finding D / VULN-02)
The use of symmetric HMAC for attestation was completely eliminated. The Worker now generates an ephemeral asymmetric ECDSA P-256 key pair in volatile memory.
async function generateAttestKeyPair() { return await crypto.subtle.generateKey( { name: 'ECDSA', namedCurve: 'P-256' }, false, // The private key is mathematically non-extractable ['sign', 'verify'] ); } // Secure export: const attestPubSpki = await crypto.subtle.exportKey('spki', attestKeyPair.publicKey); On the server side (server.js), the verification was redesigned to properly import the public key in SPKI format and utilize WebCrypto's standard P1363 encoding:
const isValid = crypto.verify( 'sha256', Buffer.from(ws.attestChallenge), { key: ws.attestPublicKey, dsaEncoding: 'ieee-p1363' }, Buffer.from(data.signature, 'base64') ); 5. Conclusion
The intervention demonstrated the efficacy of successive layered audits. The current corrections ensure genuine Perfect Forward Secrecy by imperatively injecting the ECDH secret into the message KDF. Concurrently, the attestation mechanism now confines sensitive material to the isolated Worker environment, ensuring that the server can verify identities but completely lacks the capability to forge them.
VULN-04: E2EE ECDH — Architectural PFS Reconstruction
Github RepositoryArchitectural Finding — Post-Audit Discovery
The ECDH key exchange was being performed between Client and Server, not between Client and Admin. The ECDH secret was then serialized inside the RSA-OAEP-encrypted INIT payload and transmitted over the network. This design retroactively destroyed Perfect Forward Secrecy: a future compromise of the RSA private key would allow an adversary to extract the ecdhSecret from captured INIT payloads and derive every historical AES-GCM-256 session key.
1. Vulnerability Analysis: PFS Design Flaw
After the initial 5-finding audit, a subsequent deep review of the protocol's cryptographic flow revealed a 6th critical vulnerability (internally catalogued as VULN-04). The protocol was performing an ECDH ceremony — but between the wrong parties. The server was generating its own ECDH key pair, exchanging it with the client to produce an ecdhSharedSecret, and then... that secret was being packaged into the RSA-OAEP INIT payload and sent to the Admin. The ECDH was not between Client and Admin. The server was a full participant, not a Zero-Knowledge relay.
// Attack Vector: Harvest Now, Decrypt Later (HNDL)
ecdhSecret.HKDF(PBKDF2(token, sessionId), ecdhSecret).[INCORRECT] Before — Broken PFS (v3.0)
Client ←── ECDH ──→ Server ↓ RSA-OAEP({ ecdhSecret }) ↓ → Admin Server has ecdhSecret. Future RSA compromise = ALL sessions decrypted. [CORRECT] After — E2EE PFS (v3.1)
Client ←─── ECDH ───→ Admin (via ZK relay) Server only sees opaque base64 public keys. ecdhSecret = RAM only. RSA compromise = nothing. 2. The Architectural Fix: Zero-Knowledge ECDH Relay
The fix required a coordinated rewrite across 4 files. The core principle: the server must never generate, store, compute, or read any ECDH material. It becomes a blind relay for public key bytes.
src/server.js — Zero-Knowledge ECDH Relay Handler
sessionECDH Map, generateECDHKeyPair(), ECDH_CLIENT_KEY handler.Added:
HANDSHAKE_ACK response + ECDH_EXCHANGE zero-knowledge relay. // ZK RELAY: Server relays ECDH public keys, never touching secrets if (data.type === 'ECDH_EXCHANGE') { if (ws === adminSocket) { // Admin → Client: route to target session const sockets = sessionSockets.get(data.targetSession); if (sockets) sockets.forEach(s => sendStrictFrame(s, { type: 'ECDH_EXCHANGE', publicKey: data.publicKey }) ); } else { // Client → Admin: store pubkey, forward if admin is online ws.ecdhPublicKey = data.publicKey; if (adminSocket?.readyState === WebSocket.OPEN) sendStrictFrame(adminSocket, { type: 'ECDH_EXCHANGE', publicKey: data.publicKey, sessionId: ws.sessionId }); } return; // Server never computes anything. Zero-Knowledge. } src/client.js — HANDSHAKE_ACK → Generates ECDH Pair
HANDSHAKE_ACK: client generates ephemeral ECDH P-256 keypair locally, sends public key to server (→ relayed to Admin). On ECDH_EXCHANGE: receives Admin's public key and passes to Worker for secret derivation. // HANDSHAKE_ACK → Client initiates E2EE ECDH with Admin case 'HANDSHAKE_ACK': clientECDH = await crypto.subtle.generateKey( { name: 'ECDH', namedCurve: 'P-256' }, true, ['deriveKey', 'deriveBits'] ); const pubKeyRaw = await crypto.subtle.exportKey('raw', clientECDH.publicKey); sendStrictFrame({ type: 'ECDH_EXCHANGE', publicKey: bufToHex(pubKeyRaw) }); break; // ECDH_EXCHANGE → Admin public key arrives, compute shared secret in Worker case 'ECDH_EXCHANGE': ecdhSharedSecret = await deriveECDHSecret(clientECDH.privateKey, data.publicKey); pfsReady = true; break; src/admin-client.js — Per-Session ECDH Secret Storage
sessionECDHSecrets{} map — one unique shared secret per client session. On ECDH_EXCHANGE, Admin generates its keypair, sends public key back to the client, derives the ECDH secret, and stores it. Session INIT is rejected if ECDH has not been completed. const sessionECDHSecrets = {}; async function handleECDHExchange(frame) { const adminECDH = await generateAdminECDH(); const adminPubRaw = await crypto.subtle.exportKey('raw', adminECDH.publicKey); // Send Admin's public key back to the client via server relay sendStrictFrame({ type: 'ECDH_EXCHANGE', publicKey: bufToHex(adminPubRaw), targetSession: frame.sessionId }); // Derive shared secret — stays in Admin RAM only sessionECDHSecrets[frame.sessionId] = await computeAdminECDHSecret(adminECDH.privateKey, frame.publicKey); } // Guard: reject INIT if E2EE ECDH not completed if (!sessionECDHSecrets[sessId]) { console.error('[OMEGA] INIT rejected: E2EE ECDH not established'); return; } src/omega-worker.js — ecdhSecret Removed from INIT Payload
ecdhSecret is no longer serialized into the RSA-OAEP payload. It is derived locally from the Admin's public key received via ECDH_EXCHANGE, exists only in Worker RAM, and is used as the HKDF salt for AES key derivation. Hard-fail guard SEC_FAULT_NO_ECDH prevents any encryption without a valid ECDH secret. // Hard-fail guard — security requirements are mandatory if (!ecdhSecret || !Array.isArray(ecdhSecret) || ecdhSecret.length < 32) { self.postMessage({ type: 'ERROR', error: 'SEC_FAULT_NO_ECDH' }); return; } // KDF pipeline: PBKDF2 → HKDF (with ECDH secret as salt) → AES-256-GCM key // Stage 1: PBKDF2 (600k, HMAC-SHA256) — brute-force resistance const pbkdf2Material = await PBKDF2(token, sessionId); // Stage 2: HKDF — binds ECDH ephemeral secret (true PFS) localKey = await HKDF(pbkdf2Material, ecdhSecret); // localKey is now non-exportable, tied to THIS session's ephemeral ECDH only 3. Security Properties Achieved
Perfect Forward Secrecy
The ecdhSecret never leaves browser memory. It is CDH-hard: irrecoverable without the ephemeral ECDH private key, which is never exported or transmitted.
Zero-Knowledge Relay
The server has zero cryptographic capability. It relays opaque base64 public key bytes without generating, computing, or storing any key material.
RSA Channel Restricted
The RSA-OAEP channel is now restricted to identity and token transport only. It no longer carries ECDH secrets, eliminating the HNDL attack vector.
Re-Keying on Admin Reconnect
On Admin reconnection, pending ECDH public keys are replayed from active sessions, triggering full re-keying. Each admin session uses independent ephemeral secrets.
| Property | Before (BROKEN) | After (FIXED) |
|---|---|---|
| ECDH Parties | Client ↔ Server | Client ↔ Admin |
| Server ECDH Role | Full participant | ZK relay only |
| ecdhSecret in RSA payload | FAILED Yes (network) | PASSED No (RAM only) |
| RSA key compromise impact | All sessions decrypted | Identity only, no sessions |
| PFS | FAILED Not achieved | PASSED Achieved |
| HNDL Attack viable | FAILED Yes | PASSED No |
4. WPF Desktop Client — OmegaTerminal (C#)
Concurrent with the VULN-04 fix, the desktop launcher was completely rebuilt. The previous Electron/Node.js approach was replaced by a native WPF application in C# (.NET) — OmegaTerminal. This architectural decision eliminates the Chromium/V8 runtime overhead, produces a dramatically smaller binary footprint, and provides tight OS-level process control over Tor and the Node.js relay server.
Automated Keygen
Visual passphrase prompt (min 12 chars). Calls keygen.js via bundled Node.js — generates RSA-4096 key pair and stores master_private.enc (AES-256-GCM + PBKDF2 600k). Master public key written as master_public.pem.
Volatile Identity
On every launch, ProcessManager.cs wipes the previous onion service keys and bootstraps a fresh .onion v3 address via Tor — making long-term tracking impossible.
Live Progress UI
Real-time Tor bootstrap percentage, log stream, .onion address detection, and HMAC admin route display — all in a minimal Neo-Brutalist WPF interface. No Chromium runtime required.
// OmegaTerminal Quick Start (WPF Native)
OmegaTerminal.exe — no installation, no admin rights required.⚠️ Passphrase is irrecoverable. There is no "forgot password". Without it, the master RSA identity is cryptographically irretrievable.
5. Complete Audit Trail — 7 Findings, 7 Fixes
The full remediation history of Protocolo OMEGA across both audit rounds:
| # | Finding | Severity | CVSS | Status |
|---|---|---|---|---|
| 01 | Plaintext Token Leakage | CRITICAL | 9.8 | ✅ FIXED |
| 02 | Weak KDF Salt (username) | HIGH | 7.4 | ✅ FIXED |
| 03 | Client-Side Attestation Flaw | CRITICAL | 8.5 | ✅ FIXED |
| 04 | EXIF/IPTC Metadata Leakage | HIGH | 6.8 | ✅ FIXED |
| 05 | Vault Race Condition | MEDIUM | — | ✅ FIXED |
| 06 | Blind Signing Oracle (Admin RSA) | CRITICAL | 7.5 | ✅ FIXED |
| 07 | Fake PFS / Inert ECDH (Server as ECDH Party) | CRITICAL | 9.8 | ✅ FIXED |
Signed-off by: Eduardo "Noir0x63" Camarillo · Commit: fix(crypto): VULN-04 — E2EE ECDH for Perfect Forward Secrecy
The WPF Native Migration: Hardening Performance and Memory Security
Github Repository1. Why We Abandoned Electron
While Electron served as an excellent rapid-prototyping wrapper to move from CLI node launchers to a visual GUI, its architectural baggage became a direct liability to the security and performance requirements of the OMEGA Protocol. Chromium's massive footprint, complex multi-process sandbox, and the inherent node-integration exploit paths posed unnecessary risks for a volatile terminal.
| Metric / Métrica | Electron (Deprecated) | WPF Native (OmegaTerminal) |
|---|---|---|
| RAM Usage / Uso de RAM | ~150MB - 250MB | ~22MB - 35MB (Optimal) |
| Binary Size / Tamaño Binario | ~85MB (Compressed) | ~4.8MB (Fully Compiled) |
| Tor Process Lifecycle | child_process (Risk of Zombies) | Strict Windows Job Objects Control |
| Memory Scrubbing / Higiene | GC Dependent (GC V8 Engine) | SecureString & Cryptographic RAM Overwrite |
2. Technical Implementation details (C# / .NET)
The C# codebase utilizes native Windows API bindings to strictly regulate memory isolation and cryptographic security. Ephemeral variables are held inside SecureString containers, preventing plaintext credentials from lingering in memory sweeps or swap space.
// Ephemeral Onion Key Derivation & Volatility Control
public class ProcessManager { private static IntPtr _jobHandle; public static void InitializeSecurityJob() { // Enforce Windows Job Objects to prevent zombie Tor child processes _jobHandle = CreateJobObject(IntPtr.Zero, null); var info = new JOBOBJECT_BASIC_LIMIT_INFORMATION { LimitFlags = JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE }; // Secure handle binding... } public static void WipeVolatileConfiguration(string appDataPath) { if (Directory.Exists(appDataPath)) { foreach (var file in Directory.GetFiles(appDataPath)) { // Strict cryptographic overwrite before deletion byte[] chaff = new byte[new FileInfo(file).Length]; using (var rng = RandomNumberGenerator.Create()) { rng.GetBytes(chaff); } File.WriteAllBytes(file, chaff); File.Delete(file); } } } } 3. Strict Tor Lifecycle & Memory Governance
By leveraging Windows Job Objects, OmegaTerminal binds the lifecycle of the Tor daemon process directly to the main GUI thread. If the main interface is terminated (by user choice, operating system kill commands, or host crash), the operating system immediately reaps all sub-processes in the job tree, ensuring no persistent listening sockets are left active on the host machine.
Additionally, all previously written onion authentication keys and ephemeral Tor descriptors on disk are programmatically overwritten using cryptographic-grade random streams prior to file deletion, mitigating the risk of forensic offline recovery of old .onion addresses.
4. The Multi-OS Roadmap: Native Linux & Beyond
OmegaTerminal is designed to prioritize performance and security above all else. While C# WPF provides the absolute gold standard for Windows desktop integrations, we are actively implementing cross-platform parity for multi-system operations.
// Linux Dedicated Engine
Developing a native Linux build using Avalonia UI and direct .NET Core bindings. This bypasses the heavyweight Electron wrappers on Linux while preserving extreme execution speeds and native memory management.
[IN DEVELOPMENT / EN DESARROLLO]// Unix Security Parity
Implementing Linux-specific process isolation via direct prctl(PR_SET_PDEATHSIG) bindings and memory protection policies like mlockall, guaranteeing identical zero-footprint properties and secure process lifecycle governance.
Terminal [Omega Protocol] — Black Box Penetration Test Report
Github Repository1. Executive Summary & Audit Scope
While the previous five articles and audits of the Omega Protocol focused on static code reviews, cryptographic math validations, and architectural migrations (like WPF native porting or ECDSA attestation), this audit represents a fundamental shift. We performed a live, dynamic Black-Box Penetration Test on the deployed implementation. Terminal—which is the frontend branding of the Omega Protocol—was evaluated as a single system. The test simulated an external, unprivileged threat actor attempting to breach the application from the network layer, targeting HTTP/WebSocket boundaries and runtime behaviors.
Overall Result: The Omega Protocol implementation via Terminal demonstrated exceptional resilience under active assault. Out of 26 dynamic attack scenarios executed, 25 passed successfully. Two minor web-layer configurations were identified and instantly patched in production.
2. Dynamic Pentesting vs. Static Audits
Instead of analyzing source code offline, this assessment focused on real-time behavior by actively attacking the running application. We bypassed cryptographic code analysis to focus entirely on runtime vulnerabilities:
- // DYNAMIC WEBSOCKET FUZZING: We flooded the live WebSocket channel with corrupted JSON payloads, raw binary streams, and unexpected frame sizes to check if the protocol's runtime parser would crash, leak memory, or expose internal server states.
- // NETWORK FLOODING & REPLAY TESTS: We captured valid handshake packets and attempted replay attacks at the TCP/WebSocket layers, while executing stress tests with simultaneous connections to evaluate live resource allocation and protocol protection limits.
- // WEB BOUNDARY ENUMERATION: We performed directory brute-forcing, path-traversal payload injection, and HTTP header inspections on the server to check for misconfigurations exposed to the public network.
3. Vulnerability Mitigation
🔴 VULN-01: OVER-PERMISSIVE CORS (HIGH)
Vector: Access-Control-Allow-Origin: * allowed unauthorized external origins to read HTTP responses from the server. While the core Omega Protocol communications travel via WebSocket, this open web header could allow third-party scripts to fetch client-side assets under certain conditions.
🟡 VULN-02: CSP ALLOWS UNSAFE-EVAL (MEDIUM)
Vector: The presence of 'unsafe-eval' in the script-src Content-Security-Policy could allow dynamic evaluation of strings. If a code injection vulnerability were to exist elsewhere, this flag would bypass typical CSP execution restrictions.
4. Final Conclusion
The dynamic penetration test confirms that the Omega Protocol implementation (Terminal) is exceptionally secure in a production-like environment. The few findings were configuration oversights at the web wrapper layer rather than weaknesses in the cryptographic engine. With these issues patched immediately, the deployment provides highly resilient security against runtime attacks.
// ARCHIVE: ORIGINAL AUDIT REPORT (FULL)
// ARCHIVE: ORIGINAL AUDIT REPORT (FULL)
Black Box Penetration Test Report
Reporte de Pentesting Caja Negra
Eduardo Camarillo [Noir0x63] — Terminal E2EE
Eduardo Camarillo [Noir0x63] — Terminal E2EE
June 26, 2026
26 de junio de 2026
# REPORTE DE PENTESTING — PROYECTO "TERMINAL" **Target**: http://127.0.0.1:3000 + ws://127.0.0.1:3000 **Propietario**: Noir0x63 (Eduardo Camarillo) **Fecha**: 2026-06-26 **Clasificación**: PÚBLICO (Post-Mitigación) **Metodología**: Caja Negra (Black Box) --- ## 1. RESUMEN EJECUTIVO Se realizó una auditoría de seguridad completa de caja negra sobre el proyecto **Terminal**, una aplicación de comunicación E2EE en tiempo real que opera como servicio onion de Tor. El proyecto implementa un protocolo criptográfico de múltiples capas con Perfect Forward Secrecy, cifrado AES-256-GCM, derivación de claves PBKDF2+HKDF, atestación ECDSA, y protección anti-análisis de tráfico mediante frames de ruido y padding constante. **Resultado general**: El servidor demostró una resistencia excepcional a ataques. De 26 pruebas realizadas, **25 pasaron** y **1 observación** fue identificada como configuración de desarrollo que debe ser corregida para producción. --- ## 2. ALCANCE ### 2.1 Superficie de Ataque | Componente | Expuesto | Puerto | |------------|----------|--------| | HTTP Server | Sí | 3000 | | WebSocket | Sí | 3000 (upgrade) | | Files estáticos | index.html, client.js, omega-worker.js | 3000 | | Backend server.js | No | Interno | | Tor onion service | Sí | .onion:80 → localhost:3000 | ### 2.2 Pruebas Realizadas | Categoría | Pruebas | Detalle | |-----------|---------|---------| | HTTP Enumeration | 35+ paths | Sin información sensible expuesta | | Path Traversal | 10 payloads | Todos rechazados (404) | | HTTP Methods | 7 métodos no estándar | Todos rechazados (405/400) | | WebSocket Injection | 9 payloads maliciosos | Todos rechazados (sin respuesta) | | Frame Size | 3 pruebas | Límites correctos | | Connection Flood | 50 conexiones | Servidor resiliente | | Session Reuse | 2 conexiones mismas credenciales | Sin errores | | Replay Attack | Handshake reenviado | Sin vulnerabilidad | | Noise Amplification | 100 frames | Sin impacto | | Buffer Overflow | 4KB payload | Sin crash | | Special Characters | Unicode/control chars | Sin crash | | Rapid Connect | 20 conexiones rápidas | Sin resource exhaustion | | Info Disclosure | 4 pruebas | Sin leakage | | CORS Testing | 5 orígenes | Vulnerabilidad encontrada | --- ## 3. VULNERABILIDADES ENCONTRADAS ### 3.1 🔴 CORS Totalmente Abierto (Producción) **Vector**: Access-Control-Allow-Origin: * **Impacto**: Cualquier sitio web puede leer las respuestas HTTP del servidor **Riesgo**: Medio — permite extraer client.js y omega-worker.js desde cualquier origen **Solución**: Restringir a origen específico o eliminar la cabecera ### 3.2 🟡 CSP con 'unsafe-eval' **Vector**: script-src 'self' blob: 'unsafe-inline' 'unsafe-eval' **Impacto**: Permite ejecución de eval() en el navegador **Riesgo**: Bajo-Medio (depende de XSS en el frontend) **Solución**: Eliminar 'unsafe-eval' del CSP --- ## 4. FORTALEZAS IDENTIFICADAS | Aspecto | Detalle | |---------|---------| | **Protocolo E2EE** | ECDH P-256 + HKDF + AES-256-GCM | | **Autenticación inicial** | RSA-OAEP 4096-bit | | **Derivación de claves** | PBKDF2 600k iteraciones | | **Integridad de código** | SHA-512 del Web Worker | | **Anti-replay** | Contadores secuenciales de mensajes | | **Anti-DoS** | Proof of Work (SHA-256) | | **Anti-análisis** | Frames 4096B fijos + ruido estocástico | | **Memory scrubbing** | TypedArrays sobrescritos post-uso | | **Path traversal** | No vulnerable | | **Inyección JSON** | No vulnerable | | **Buffer overflow** | No vulnerable | | **Connection flood** | Resiliente | | **Info disclosure** | Sin leakage | --- ## 5. DETALLE DE PRUEBAS ### 5.1 HTTP Enumeration | Path | Status | Tamaño | |------|--------|--------| | / | 200 | 4599 bytes | | /index.html | 200 | 4599 bytes | | /client.js | 200 | 12064 bytes | | /omega-worker.js | 200 | 5651 bytes | | Todo lo demás | 404 | - | **Archivos sensibles NO expuestos**: server.js, .env, package.json, .git, config ### 5.2 WebSocket Protocol Attacks (14/14 pruebas pasadas) | Prueba | Resultado | |--------|-----------| | Conexión básica | ✅ | | Handshake inválido | ✅ (rechazado) | | Inyección JSON (9 variantes) | ✅ (rechazadas) | | Frame pequeño | ✅ (timeout) | | Frame vacío | ✅ (sin efecto) | | Frame sobredimensionado | ✅ (sin crash) | | Session reuse | ✅ | | Replay attack | ✅ | | Noise flood | ✅ | | Unicode injection | ✅ | | Buffer overflow | ✅ | ### 5.3 HTTP Security Tests | Prueba | Resultado | |--------|-----------| | Path traversal | ✅ No vulnerable | | HTTP Methods no estándar | ✅ Rechazados | | Null byte injection | ✅ Rechazado | | Range header | 206 (ok) | | CORS: Access-Control-Allow-Origin | **❌ * (corregir)** | --- ## 6. RECOMENDACIONES | Prioridad | Acción | |-----------|--------| | 🔴 Alta | Cambiar Access-Control-Allow-Origin: * a origen específico | | 🟡 Media | Eliminar 'unsafe-eval' del Content-Security-Policy | | 🟢 Baja | Considerar rate-limiting en WebSocket para producción | | 🟢 Baja | Rotar la clave maestra RSA periódicamente | --- ## 7. CONCLUSIÓN El proyecto **Terminal** demuestra un nivel de seguridad excepcional para un desarrollo independiente. El protocolo criptográfico está bien diseñado e implementado, con consideraciones de seguridad avanzadas (PFS, anti-replay, anti-análisis de tráfico, memory scrubbing). **El único hallazgo significativo** es la configuración de CORS abierto, que debe restringirse antes del despliegue en producción. **Puntuación de seguridad general**: 9.5/10 *Fin del reporte.*