{"id":"CVE-2024-39918","aliases":["EUVD-2024-2427","GHSA-vvmv-wrvp-9gjr"],"status":"published","title":"Path Traveral in @jmondi/url-to-png","description":"@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. Input of the `ImageId` in the code is not sanitized and may lead to path traversal. This allows an attacker to store an image in an arbitrary location that the server has permission to access. This issue has been addressed in version 2.1.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.","severity":{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00528,"percentile":0.45136,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22"],"published":"2024-07-15T17:46:57Z","modified":"2026-10-28T02:30:44Z","fixes":[{"ecosystem":"npm","package":"@jmondi/url-to-png","fixed_in":["2.1.2"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"npm","package":"@jmondi/url-to-png","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1.2"}]}]},{"source":"osv","ecosystem":"npm","package":"@jmondi/url-to-png","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.1.2"}]}]}],"products":[{"vendor":"jasonraimondi","product":"url-to-png"}],"references":[{"url":"https://github.com/jasonraimondi/url-to-png/security/advisories/GHSA-vvmv-wrvp-9gjr","tags":["x_refsource_CONFIRM","x_transferred","advisory","web"]},{"url":"https://github.com/jasonraimondi/url-to-png/commit/e4eaeca6493b21cd515b582fd6c0af09ede54507","tags":["x_refsource_MISC","x_transferred","fix","web"]},{"url":"https://github.com/jasonraimondi/url-to-png/blob/e43098e0af3a380ebc044e7f303a83933b94b434/src/middlewares/extract_query_params.ts#L75","tags":["x_refsource_MISC","x_transferred","web"]},{"url":"https://github.com/jasonraimondi/url-to-png/releases/tag/v2.1.2","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-39918","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-vvmv-wrvp-9gjr"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/39xxx/CVE-2024-39918.json","tags":["advisory"]},{"url":"https://github.com/jasonraimondi/url-to-png","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2024-39918","title":"Path Traveral in @jmondi/url-to-png","description":"@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. Input of the `ImageId` in the code is not sanitized and may lead to path traversal. This allows an attacker to store an image in an arbitrary location that the server has permission to access. This issue has been addressed in version 2.1.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.\n","status":"published","published":"2024-07-15T19:53:20.491Z","modified":"2024-08-02T04:33:11.66Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:34:19.28149Z"}],"euvd":[{"id":"EUVD-2024-2427","description":"@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. Input of the `ImageId` in the code is not sanitized and may lead to path traversal. This allows an attacker to store an image in an arbitrary location that the server has permission to access. This issue has been addressed in version 2.1.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.\n","status":"published","published":"2024-07-15T19:53:20Z","modified":"2024-08-02T04:33:11Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"updated_at":"2026-11-03T03:50:17.469599Z"}],"ghsa":[{"id":"GHSA-vvmv-wrvp-9gjr","title":"@jmondi/url-to-png contains a Path Traversal vulnerability","description":"### Summary\nWhen trying to add a `BLOCK_LIST` feature when the maintainer noticed they didn't sanitize the `ImageId` in the code, which leads to path traversal vulnerability. Now, this is different from a traditional path traversal issue, because as of NOW you can store the image in any place arbitrarily, and given enough time they might be able to come up with a working exploit BUT for the time being they am reporting this.  \n\n### Details\n\n@jmondi/url-to-png does not sanitizing the `ImageID` as in not removing special chars from the params [(extract_query_params.ts#l75)](https://github.com/jasonraimondi/url-to-png/blob/e43098e0af3a380ebc044e7f303a83933b94b434/src/middlewares/extract_query_params.ts#L75)\n\n```js\nconst imageId = dateString + \".\" + slugify(validData.url) +configToString(params);\n```\n\nThis when fed to other parts of the code such as ([filesystem.ts#L34](https://github.com/jasonraimondi/url-to-png/blob/8afc00247c1d7e6c7b37356a5f6282b486e596fa/src/lib/storage/filesystem.ts#L34))\n\n```js\nreturn path.join(this.storagePath, imageId) + \".png\";\n```\n\nWould result in path traversal issue. \n\n### PoC\n\n```\n# Configuration for filesystem storage provider (optional)\nSTORAGE_PROVIDER=filesystem\nIMAGE_STORAGE_PATH=poc\n```\n\nSet this in your `.env` file and use this as your payload. \n\n```\nhttp://localhost:3089/?url=http://example.com\u0026width=400\u0026isDarkMode=../../../../../../../../../../../../tmp/hack\n```\n\nThis will create a `.png` file in the `/tmp` section of the system.\n\nLoom POC: https://www.loom.com/share/bd7b306cdae7445c97e68f0626e743a6 \n\n\n\nThis is valid for pretty much all the arguments (except for numeric values)\n\nA simple fix would be to use the `slugify` for the params as well like so ([#L75](https://github.com/jasonraimondi/url-to-png/blob/e43098e0af3a380ebc044e7f303a83933b94b434/src/middlewares/extract_query_params.ts#L75))\n\n```diff\n- const imageId = dateString + \".\" + slugify(validData.url) + configToString(params);\n+ const imageId = dateString + \".\" + slugify(validData.url) + slugify(configToString(params));\n```\n\n\n### Impact\nThis would be path traversal vulnerability which allows arbitrary write as of now. \n","status":"published","published":"2024-07-15T17:46:57Z","modified":"2024-08-04T05:03:33Z","cvss":[{"version":"4.0","score":6.9,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:37:57.422393Z"}],"nvd":[{"id":"CVE-2024-39918","description":"@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. Input of the `ImageId` in the code is not sanitized and may lead to path traversal. This allows an attacker to store an image in an arbitrary location that the server has permission to access. This issue has been addressed in version 2.1.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.\n","status":"published","published":"2024-07-15T20:15:04.16Z","modified":"2026-06-17T07:43:01.41Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium","assessor":"secondary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:10:12.994089Z"}],"osv":[{"id":"CVE-2024-39918","title":"Path Traveral in @jmondi/url-to-png","description":"@jmondi/url-to-png is an open source URL to PNG utility featuring parallel rendering using Playwright for screenshots and with storage caching via Local, S3, or CouchDB. Input of the `ImageId` in the code is not sanitized and may lead to path traversal. This allows an attacker to store an image in an arbitrary location that the server has permission to access. This issue has been addressed in version 2.1.2 and all users are advised to upgrade. There are no known workarounds for this vulnerability.\n","status":"published","published":"2024-07-15T19:53:20.491Z","modified":"2026-10-28T02:30:44.332144428Z","cvss":[{"version":"3.1","score":4.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:44:41.618074Z"},{"id":"GHSA-vvmv-wrvp-9gjr","title":"@jmondi/url-to-png contains a Path Traversal vulnerability","description":"### Summary\nWhen trying to add a `BLOCK_LIST` feature when the maintainer noticed they didn't sanitize the `ImageId` in the code, which leads to path traversal vulnerability. Now, this is different from a traditional path traversal issue, because as of NOW you can store the image in any place arbitrarily, and given enough time they might be able to come up with a working exploit BUT for the time being they am reporting this.  \n\n### Details\n\n@jmondi/url-to-png does not sanitizing the `ImageID` as in not removing special chars from the params [(extract_query_params.ts#l75)](https://github.com/jasonraimondi/url-to-png/blob/e43098e0af3a380ebc044e7f303a83933b94b434/src/middlewares/extract_query_params.ts#L75)\n\n```js\nconst imageId = dateString + \".\" + slugify(validData.url) +configToString(params);\n```\n\nThis when fed to other parts of the code such as ([filesystem.ts#L34](https://github.com/jasonraimondi/url-to-png/blob/8afc00247c1d7e6c7b37356a5f6282b486e596fa/src/lib/storage/filesystem.ts#L34))\n\n```js\nreturn path.join(this.storagePath, imageId) + \".png\";\n```\n\nWould result in path traversal issue. \n\n### PoC\n\n```\n# Configuration for filesystem storage provider (optional)\nSTORAGE_PROVIDER=filesystem\nIMAGE_STORAGE_PATH=poc\n```\n\nSet this in your `.env` file and use this as your payload. \n\n```\nhttp://localhost:3089/?url=http://example.com\u0026width=400\u0026isDarkMode=../../../../../../../../../../../../tmp/hack\n```\n\nThis will create a `.png` file in the `/tmp` section of the system.\n\nLoom POC: https://www.loom.com/share/bd7b306cdae7445c97e68f0626e743a6 \n\n\n\nThis is valid for pretty much all the arguments (except for numeric values)\n\nA simple fix would be to use the `slugify` for the params as well like so ([#L75](https://github.com/jasonraimondi/url-to-png/blob/e43098e0af3a380ebc044e7f303a83933b94b434/src/middlewares/extract_query_params.ts#L75))\n\n```diff\n- const imageId = dateString + \".\" + slugify(validData.url) + configToString(params);\n+ const imageId = dateString + \".\" + slugify(validData.url) + slugify(configToString(params));\n```\n\n\n### Impact\nThis would be path traversal vulnerability which allows arbitrary write as of now. \n","status":"published","published":"2024-07-15T17:46:57Z","modified":"2026-09-10T03:50:16.990096613Z","cvss":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"medium"},{"version":"4.0","score":6.9,"vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N","level":"medium"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:57.694388Z"}]}}
