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:
openhands
2026-07-13 12:21:37 +02:00
parent e2fc7ea1a4
commit e5ae51bff7
41 changed files with 152 additions and 152 deletions
+3 -3
View File
@@ -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);