My site prismatic-genie-9fcc79
usually gets a few hits a week, but on 28 Feb it started getting 13k failed Serverless function calls per day. They all look like this:
AM: e3e99752 Duration: 88.14 ms Memory Usage: 135 MB
Mar 5, 10:27:53 AM: f2892af4 ERROR Error: Expected integer between 1 and 100 for quality but received N'-bo2sw6t-, of type string
Mar 5, 10:27:53 AM: f2892af4 ERROR at Object.invalidParameterError (/var/task/node_modules/sharp/lib/is.js:135:10)
Mar 5, 10:27:53 AM: f2892af4 ERROR at Sharp.jpeg (/var/task/node_modules/sharp/lib/output.js:321:18)
Mar 5, 10:27:53 AM: f2892af4 ERROR at Sharp.toFormat (/var/task/node_modules/sharp/lib/output.js:277:28)
Mar 5, 10:27:53 AM: f2892af4 ERROR at /var/task/node_modules/ipx/dist/index.cjs:526:23
Mar 5, 10:27:53 AM: f2892af4 ERROR at async _handleRequest (/var/task/node_modules/ipx/dist/index.cjs:598:28)
Mar 5, 10:27:53 AM: f2892af4 ERROR at async handler (/var/task/node_modules/@netlify/ipx/dist/index.js:144:25)
Mar 5, 10:27:53 AM: f2892af4 Duration: 61.18 ms Memory Usage: 135 MB
Mar 5, 10:27:53 AM: f01a14bc ERROR Error: Expected positive integer for width but received ../../etc/passwd of type string
Mar 5, 10:27:53 AM: f01a14bc ERROR at Object.invalidParameterError (/var/task/node_modules/sharp/lib/is.js:135:10)
Mar 5, 10:27:53 AM: f01a14bc ERROR at Sharp.resize (/var/task/node_modules/sharp/lib/resize.js:259:16)
Mar 5, 10:27:53 AM: f01a14bc ERROR at Object.apply (/var/task/node_modules/ipx/dist/index.cjs:266:17)
Mar 5, 10:27:53 AM: f01a14bc ERROR at applyHandler (/var/task/node_modules/ipx/dist/index.cjs:201:18)
Mar 5, 10:27:53 AM: f01a14bc ERROR at /var/task/node_modules/ipx/dist/index.cjs:523:17
Mar 5, 10:27:53 AM: f01a14bc ERROR at async _handleRequest (/var/task/node_modules/ipx/dist/index.cjs:598:28)
Mar 5, 10:27:53 AM: f01a14bc ERROR at async handler (/var/task/node_modules/@netlify/ipx/dist/index.js:144:25)
Is there a path traversal issue with sharp
’s jpg? And is there anything you guys can do about this flood of obviously-malicious traffic? Note that my site uses NextJS, but my package-lock.json
does not include sharp
, so it seems like this is a dependency on your side.
This site is using NextJS 12.2.5, which is quite old and had other DoS issues with next/image
, so I’ll update it. But I’m not sure if that will stop the traffic…