<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[[1.6.0-beta] productKeyIsValid() regex missing letter &#x27;N&#x27; — rejects valid Windows Enterprise product keys]]></title><description><![CDATA[<p dir="auto">Hi all, <a class="mention plugin-mentions-user plugin-mentions-a" href="http://forums.fogproject.org/uid/7217">@Tom-Elliott</a> <a class="mention plugin-mentions-user plugin-mentions-a" href="http://forums.fogproject.org/uid/28061">@Sebastian-Roth</a></p>
<p dir="auto">I found a bug in the Windows product key validation introduced in the Channel Beta | Version 1.6.0-beta.5384.</p>
<p dir="auto"><strong>Issue:</strong><br />
A legitimate corporate Windows 11 Enterprise volume-license product key (containing the letter N) was rejected on the Host Management “General” tab with the error “Invalid Windows product key” (HTTP 400). The same key was accepted without issue on older FOG versions (pre-1.6.0-beta strict validation).</p>
<p dir="auto"><strong>Root cause:</strong><br />
File: <code>src/Base/FOGBase.php</code>, function <code>productKeyIsValid()</code> (around line 2758)</p>
<pre><code class="language-php">public static function productKeyIsValid($val)
{
    return (bool)preg_match(
        '/^[BCDFGHJKMPQRTVWXY2346789]{25}$/',
        self::productKeyStrip($val)
    );
}
</code></pre>
<p dir="auto">The allowed character class <code>BCDFGHJKMPQRTVWXY2346789</code> is missing the letter <strong>N</strong>, which IS a valid character in the official Windows product key alphabet.</p>
<p dir="auto"><strong>Evidence N is valid:</strong><br />
Many official Microsoft KMS Client Setup Keys contain N, e.g.:</p>
<ul>
<li>Windows 10/11 Pro: W269N-WFGWX-YVC9B-4J6C9-T83GX</li>
<li>Windows 10/11 Enterprise: NPPR9-FWDCX-D2C8J-H872K-2YT43</li>
<li>Windows 10/11 Pro N: MH37W-N47XK-V7XM9-C7227-GCQG9</li>
</ul>
<p dir="auto">Source: <a href="https://learn.microsoft.com/en-us/windows-server/get-started/kmsclientkeys" target="_blank" rel="noopener noreferrer nofollow ugc">https://learn.microsoft.com/en-us/windows-server/get-started/kmsclientkeys</a></p>
<p dir="auto"><strong>Steps to reproduce:</strong></p>
<ol>
<li>Host Management → edit a host → General tab</li>
<li>Enter a valid Windows Enterprise/volume product key containing the letter N</li>
<li>Click Update</li>
<li>FOG rejects it as “Invalid Windows product key”</li>
</ol>
<p dir="auto"><strong>Suggested fix:</strong><br />
Add N to the character class:<br />
‘/^[BCDFGHJKMNPQRTVWXY2346789]{25}$/’</p>
<p dir="auto"><strong>Workaround applied locally (via sed) while waiting for an official fix:</strong></p>
<p dir="auto">sudo sed -i “s/[BCDFGHJKMPQRTVWXY2346789]/[BCDFGHJKMNPQRTVWXY2346789]/” /var/www/fog/src/Base/FOGBase.php</p>
<p dir="auto">Confirmed working after this change.</p>
<p dir="auto"><strong>Environment:</strong></p>
<ul>
<li>FOG Version: 1.6.0-beta.5384 (Channel Beta, branch working-1.6)</li>
<li>OS: Ubuntu 26.04.1 LTS “Resolute”</li>
</ul>
<p dir="auto">Thanks!</p>
]]></description><link>http://forums.fogproject.org/topic/18252/1-6-0-beta-productkeyisvalid-regex-missing-letter-n-rejects-valid-windows-enterprise-product-keys</link><generator>RSS for Node</generator><lastBuildDate>Mon, 21 Sep 2026 22:10:12 GMT</lastBuildDate><atom:link href="http://forums.fogproject.org/topic/18252.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 21 Sep 2026 20:32:44 GMT</pubDate><ttl>60</ttl></channel></rss>