[SECURITY] Insecure AES-GCM nonce usage in website_handlers #19

Open
opened 2026-02-14 21:24:45 +00:00 by thabeta · 0 comments
Owner

The decrypt_block function in src/server/website_handlers.rs uses the encryption key as the nonce for AES-GCM decryption.

let nonce = Nonce::from_slice(&block.key[..12]);

Risk: Reusing the key (or even a subset of it) as a nonce is a major cryptographic failing in AES-GCM. It can lead to the "Forbidden Attack," allowing an attacker to recover the authentication key or decrypt other blocks if the same key/nonce pair is used more than once.

Fix: Ensure the meta::Block structure stores a unique, randomly generated nonce alongside the key and block ID.

The `decrypt_block` function in `src/server/website_handlers.rs` uses the encryption key as the nonce for AES-GCM decryption. ```rust let nonce = Nonce::from_slice(&block.key[..12]); ``` **Risk:** Reusing the key (or even a subset of it) as a nonce is a major cryptographic failing in AES-GCM. It can lead to the "Forbidden Attack," allowing an attacker to recover the authentication key or decrypt other blocks if the same key/nonce pair is used more than once. **Fix:** Ensure the `meta::Block` structure stores a unique, randomly generated nonce alongside the key and block ID.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
geomind_code/my_fs#19
No description provided.