Headline
CVE-2022-41957: Feature/finding null pointer by julianhille · Pull Request #235 · julianhille/MuhammaraJS
Muhammara is a node module with c/cpp bindings to modify PDF with JavaScript for node or electron. The package muhammara before 2.6.2 and from 3.0.0 and before 3.3.0, as well as all versions of muhammara’s predecessor package hummus, are vulnerable to Denial of Service (DoS) when supplied with a maliciously crafted PDF file to be parsed. The issue has been patched in muhammara version 3.4.0 and the fix has been backported to version 2.6.2. As a workaround, do not process files from untrusted sources. If using hummus, replace the package with muhammara.
well its all in teh unexpected area so any decision is good.
Inspecting all usages there’s a pattern of checking for an array, then if it’s 4 and then either going for a default or calling SetPDFRectangleFromArray.
so that array check+ 4 check can be moved into SetPDFRectangleFromArray for better reuse and that it’d return status. then it’s `if(SetPDFRectangleFromArray(…) == eFailure) do_the_default.
Related news
### Impact The package muhammara before 2.6.2, from 3.0.0 and before 3.3.0; all versions of package hummus are vulnerable to Denial of Service (DoS) when supplied with a maliciously crafted PDF file to be parsed. ### Patches It has been patched in 3.4.0 and has been backported to 2.6.2 There is no patch for hummus, currently ### Workarounds Do not process files from untrusted sources or update. Replace hummus with muhammara ### References https://github.com/julianhille/MuhammaraJS/pull/235 https://github.com/julianhille/MuhammaraJS/pull/238