XOR
XORKavramKriptografi ve gizlilerDiğer adlar: exclusive or
Kalıcı bağlantıA bitwise operation outputting 1 where two input bits differ and 0 where they match, central to stream ciphers and GCM nonce hazards.
Exclusive OR (XOR) is reversible by applying the same keystream twice: (A XOR K) XOR K = A. Because AES-GCM encrypts plaintext by XORing it with a keystream derived from the key and nonce, reusing a nonce reuses the exact same keystream K, so (P1 XOR K) XOR (P2 XOR K) cancels K out and reveals P1 XOR P2. For example, knowing one standard JSON prefix in P1 immediately uncovers the matching characters of P2.
Bu depoda nasıl kullanılır
Explains why packages/vault/src/envelope.ts generates a fresh random 12-byte IV on every AES-256-GCM encryption and never allows caller-supplied static IVs in production paths.
İlgili dosyalar:packages/vault/src/envelope.ts
XSS
XSSKavramSaldırı ve savunmalarDiğer adlar: cross-site scripting, script injection
Kalıcı bağlantıCross-Site Scripting: injecting attacker-controlled JavaScript into a trusted web page so it executes inside a victim's browser session.
If an attacker injects <script> or an unsafe javascript: link into a stored campaign name, audit note, or reflected URL and the page renders it unescaped, the script runs inside the victim's origin with full power to call authenticated APIs. Defending against XSS combines React's default JSX escaping, banning unsafe raw-HTML injection (dangerouslySetInnerHTML), validating link URI schemes, marking session cookies HttpOnly, and enforcing a strict Content-Security-Policy. For example, even if XSS somehow fired, HttpOnly cookies keep raw session tokens hidden from document.cookie.
Bu depoda nasıl kullanılır
Mitigated by React JSX escaping in apps/web, unsafe-URI rejection, HttpOnly cookies, and strict CSP in apps/api/src/platform/hardening.ts.
İlgili dosyalar:apps/api/src/platform/hardening.ts