The vulnerability lies in the way Rhino's toFixed() function handled the conversion of very small floating-point numbers to strings. The advisory explicitly provides the vulnerable call stack: NativeNumber.numTo -> DToA.JS_dtostr -> DToA.JS_dtoa -> DToA.pow5mult. The pow5mult function would enter a long-running loop, consuming significant CPU and causing a denial of service.
The provided patch at commit 2bcf4c43deace35f1f57d86377c6767b0608986e addresses this by completely replacing the vulnerable number formatting logic.
In src/org/mozilla/javascript/NativeNumber.java, the execIdCall method, which dispatches calls to toFixed, toExponential, etc., is modified. The call to the now-removed num_to function for the Id_toFixed case is replaced with a call to a new js_toFixed method. The num_to function was the bridge to the vulnerable DToA library. Its removal for toFixed calls is the core of the fix.
The new implementation in js_toFixed leverages a newly added class, org.mozilla.javascript.dtoa.DecimalFormatter, which uses Java's BigDecimal for number formatting. This avoids the problematic custom DToA implementation for the vulnerable cases.
Therefore, the key vulnerable functions that would appear in a runtime profile during exploitation are org.mozilla.javascript.NativeNumber.num_to and org.mozilla.javascript.DToA.JS_dtostr, as they are the entry points into the vulnerable code path that was removed by the patch.