Add NFC normalization to all FormData inputs across 41 server actions
All user-supplied string values from FormData now go through
String.prototype.normalize('NFC') to prevent Unicode homoglyph
attacks and canonicalization bypasses. NFC is idempotent for
already-normalized strings, so this is a pure security improvement
with zero behavioral change for legitimate users.
This commit is contained in:
@@ -41,9 +41,9 @@ export async function updateUser(formData: FormData): Promise<void> {
|
||||
if (!existing) return;
|
||||
|
||||
// users row — only existing, safe columns.
|
||||
const mailRaw = String(formData.get("mail") ?? "").trim();
|
||||
const motto = String(formData.get("motto") ?? "").slice(0, 127);
|
||||
const look = String(formData.get("look") ?? "").slice(0, 256);
|
||||
const mailRaw = String(formData.get("mail") ?? "").normalize("NFC").trim();
|
||||
const motto = String(formData.get("motto") ?? "").normalize("NFC").slice(0, 127);
|
||||
const look = String(formData.get("look") ?? "").normalize("NFC").slice(0, 256);
|
||||
const rank = toInt(formData.get("rank"), 1);
|
||||
const credits = toInt(formData.get("credits"), 0);
|
||||
const pixels = toInt(formData.get("pixels"), 0);
|
||||
|
||||
Reference in New Issue
Block a user