From 5b245c8aef1b2ba2464802ee43d9d4d19381cb6c Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 7 Feb 2025 15:02:49 -0800 Subject: [PATCH] Sanity check the SOA serial https://github.com/virtualmin/virtualmin-gpl/issues/1004 --- bind8/lang/en | 1 + bind8/save_soa.cgi | 1 + 2 files changed, 2 insertions(+) diff --git a/bind8/lang/en b/bind8/lang/en index 20d599298..cba478590 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -141,6 +141,7 @@ master_emip=Invalid master IP '$1' master_esetup=BIND module is not set up master_eview=View $1 was not found master_eserial=Serial number must be a string of digits +master_eserial2=Serial number must be less than 2^31 master_apply=Apply Changes master_applymsg2=Click this button to apply changes for this zone only. This will only work if changes have been applied for the entire server at least once since the zone was created. master_defttl=Default time-to-live for records diff --git a/bind8/save_soa.cgi b/bind8/save_soa.cgi index 8bd6491a2..84b5a77d7 100755 --- a/bind8/save_soa.cgi +++ b/bind8/save_soa.cgi @@ -56,6 +56,7 @@ if ($config{'updserial_on'}) { } else { $in{'serial'} =~ /^\d+$/ || &error($text{'master_eserial'}); + $in{'serial'} < 2**31 || &error($text{'master_eserial2'}); $serial = $in{'serial'}; } my $vals = "$in{'master'} $in{'email'} (\n".