The vulnerability is a CPU amplification (CWE-400/CWE-407) in Daptin's global LanguageMiddleware. The root cause is that the raw Accept-Language HTTP header is passed unfiltered to golang.org/x/text/language.ParseAcceptLanguage. The parser's CVE-2022-32149 guard only counts '-' characters, but the internal scanner normalizes '_' to '-', so underscore-separated subtags longer than 8 characters bypass the guard and drive the parser into an O(N²) gobble/memmove path.
The fix commit 2d70950979b51eb6c8b4234dd50558b608ad2ffe modifies server/language.go to add a separator-count guard (maxAcceptLanguageSeparators = 32) counting both '-' and '_'. Two functions are directly involved in the vulnerable path:
-
LanguageMiddlewareFunc (method on *LanguageMiddleware) - the gin middleware entry point that reads c.GetHeader("Accept-Language") and passes it to GetLanguagePreference. Before the fix, it passed the raw header with no filter. This is the function that would appear in a runtime profile/stack trace when an attacker sends a malicious Accept-Language header.
-
GetLanguagePreference - the function that actually calls language.ParseAcceptLanguage(preferredLanguage) and resource.CheckErr (which logs the entire header). Before the fix, it passed the raw header directly to the parser with no size/shape filter.
Both functions were modified by the patch to add the acceptLanguageTooComplex guard. The new helper acceptLanguageTooComplex is a mitigation (added by the fix), not a vulnerable function, so it is correctly excluded. The vulnerable functions are the ones that lacked the check before the fix.
For Go profilers, function names appear as package-qualified names. The package is 'server', so the functions would appear as 'server.LanguageMiddlewareFunc' and 'server.GetLanguagePreference' (or with the method receiver as 'server.(*LanguageMiddleware).LanguageMiddlewareFunc'). I've reported the plain function names consistent with the Go profiler convention of stripping module paths while keeping the package/type context minimal.