From 71cda50b65fb0e7cda6331b087266661736c109e Mon Sep 17 00:00:00 2001 From: Arsen Bekirov Date: Fri, 29 May 2026 18:54:29 +0300 Subject: [PATCH] fix: validate recordId before split in googledns deleteRecord (#454) --- packages/dns/googledns/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/dns/googledns/src/index.ts b/packages/dns/googledns/src/index.ts index dbb4c535..23e9a44e 100644 --- a/packages/dns/googledns/src/index.ts +++ b/packages/dns/googledns/src/index.ts @@ -123,6 +123,9 @@ export default defineDns({ const token = await getAccessToken(); const project = config.projectId ?? _secret('GOOGLE_PROJECT_ID'); if (!project) throw new Error('GOOGLE_PROJECT_ID not set'); + if (typeof recordId !== 'string' || !recordId.includes('/')) { + throw new Error(`Invalid recordId: ${recordId}. Expected format: "/"`); + } const [type, name] = recordId.split('/'); // Need to fetch the rrset to get current rrdatas for the deletion entry. const existing = (await this.listRecords(zoneId, config)).filter(