{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":729737921,"defaultBranch":"main","name":"chinese-chart","ownerLogin":"SebastianGoeb","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2023-12-10T07:29:29.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/3440852?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1726609339.0","currentOid":""},"activityList":{"items":[{"before":"525f19270dc3a49d3c9b00b8f2c51d80d303924a","after":"1a75f0c5dcc26493a7afaecf008f0ba4c2168582","ref":"refs/heads/renovate/major-eslint-monorepo","pushedAt":"2024-09-18T00:28:13.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"renovate[bot]","name":null,"path":"/apps/renovate","primaryAvatarUrl":"https://avatars.githubusercontent.com/in/2740?s=80&v=4"},"commit":{"message":"chore(deps): update dependency eslint to v9","shortMessageHtmlLink":"chore(deps): update dependency eslint to v9"}},{"before":"b913ea778e2abc3408aacb931e54ac4f61baed46","after":null,"ref":"refs/heads/renovate/npm-vite-vulnerability","pushedAt":"2024-09-17T21:42:19.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"renovate[bot]","name":null,"path":"/apps/renovate","primaryAvatarUrl":"https://avatars.githubusercontent.com/in/2740?s=80&v=4"}},{"before":"38f441e2c6d77d8b9213d6edb361c643da8b5a77","after":"170b9a839d9b94d4e4f72cb1e0d40dd334e38984","ref":"refs/heads/main","pushedAt":"2024-09-17T21:42:18.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"renovate[bot]","name":null,"path":"/apps/renovate","primaryAvatarUrl":"https://avatars.githubusercontent.com/in/2740?s=80&v=4"},"commit":{"message":"chore(deps): update dependency vite to v5.4.6 [security] (#176)\n\nThis PR contains the following updates:\n\n| Package | Change | Age | Adoption | Passing | Confidence |\n|---|---|---|---|---|---|\n| [vite](https://vitejs.dev)\n([source](https://redirect.github.com/vitejs/vite/tree/HEAD/packages/vite))\n| [`5.4.5` ->\n`5.4.6`](https://renovatebot.com/diffs/npm/vite/5.4.5/5.4.6) |\n[![age](https://developer.mend.io/api/mc/badges/age/npm/vite/5.4.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)\n|\n[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/vite/5.4.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)\n|\n[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/vite/5.4.5/5.4.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)\n|\n[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vite/5.4.5/5.4.6?slim=true)](https://docs.renovatebot.com/merge-confidence/)\n|\n\n### GitHub Vulnerability Alerts\n\n####\n[CVE-2024-45811](https://redirect.github.com/vitejs/vite/security/advisories/GHSA-9cwx-2883-4wfx)\n\n### Summary\nThe contents of arbitrary files can be returned to the browser.\n\n### Details\n`@fs` denies access to files outside of Vite serving allow list. Adding\n`?import&raw` to the URL bypasses this limitation and returns the file\ncontent if it exists.\n\n### PoC\n```sh\n$ npm create vite@latest\n$ cd vite-project/\n$ npm install\n$ npm run dev\n\n$ echo \"top secret content\" > /tmp/secret.txt\n\n# expected behaviour\n$ curl \"http://localhost:5173/@fs/tmp/secret.txt\"\n\n
\nThe request url "/tmp/secret.txt" is outside of Vite serving allow list.\n\n# security bypassed\n$ curl \"http://localhost:5173/@fs/tmp/secret.txt?import&raw\"\nexport default \"top secret content\\n\"\n//# sourceMappingURL=data:application/json;base64,eyJ2...\n```\n\n####\n[CVE-2024-45812](https://redirect.github.com/vitejs/vite/security/advisories/GHSA-64vr-g452-qvp3)\n\n### Summary\n\nWe discovered a DOM Clobbering vulnerability in Vite when building\nscripts to `cjs`/`iife`/`umd` output format. The DOM Clobbering gadget\nin the module can lead to cross-site scripting (XSS) in web pages where\nscriptless attacker-controlled HTML elements (e.g., an img tag with an\nunsanitized name attribute) are present.\n\nNote that, we have identified similar security issues in Webpack:\nhttps://github.com/webpack/webpack/security/advisories/GHSA-4vvj-4cpr-p986\n\n### Details\n\n**Backgrounds**\n\nDOM Clobbering is a type of code-reuse attack where the attacker first\nembeds a piece of non-script, seemingly benign HTML markups in the\nwebpage (e.g. through a post or comment) and leverages the gadgets\n(pieces of js code) living in the existing javascript code to transform\nit into executable code. More for information about DOM Clobbering, here\nare some references:\n\n[1] https://scnps.co/papers/sp23_domclob.pdf\n[2] https://research.securitum.com/xss-in-amp4email-dom-clobbering/\n\n**Gadgets found in Vite**\n\nWe have identified a DOM Clobbering vulnerability in Vite bundled\nscripts, particularly when the scripts dynamically import other scripts\nfrom the assets folder and the developer sets the build output format to\n`cjs`, `iife`, or `umd`. In such cases, Vite replaces relative paths\nstarting with `__VITE_ASSET__` using the URL retrieved from\n`document.currentScript`.\n\nHowever, this implementation is vulnerable to a DOM Clobbering attack.\nThe `document.currentScript` lookup can be shadowed by an attacker via\nthe browser's named DOM tree element access mechanism. This manipulation\nallows an attacker to replace the intended script element with a\nmalicious HTML element. When this happens, the src attribute of the\nattacker-controlled element is used as the URL for importing scripts,\npotentially leading to the dynamic loading of scripts from an\nattacker-controlled server.\n\n```\nconst relativeUrlMechanisms = {\n amd: (relativePath) => {\n if (relativePath[0] !== \".\") relativePath = \"./\" + relativePath;\n return getResolveUrl(\n `require.toUrl('${escapeId(relativePath)}'), document.baseURI`\n );\n },\n cjs: (relativePath) => `(typeof document === 'undefined' ? ${getFileUrlFromRelativePath(\n relativePath\n )} : ${getRelativeUrlFromDocument(relativePath)})`,\n es: (relativePath) => getResolveUrl(\n `'${escapeId(partialEncodeURIPath(relativePath))}', import.meta.url`\n ),\n iife: (relativePath) => getRelativeUrlFromDocument(relativePath),\n // NOTE: make sure rollup generate `module` params\n system: (relativePath) => getResolveUrl(\n `'${escapeId(partialEncodeURIPath(relativePath))}', module.meta.url`\n ),\n umd: (relativePath) => `(typeof document === 'undefined' && typeof location === 'undefined' ? ${getFileUrlFromRelativePath(\n relativePath\n )} : ${getRelativeUrlFromDocument(relativePath, true)})`\n};\n```\n\n### PoC\n\nConsidering a website that contains the following `main.js` script, the\ndevloper decides to use the Vite to bundle up the program with the\nfollowing configuration.\n\n```\n// main.js\nimport extraURL from './extra.js?url'\nvar s = document.createElement('script')\ns.src = extraURL\ndocument.head.append(s)\n```\n\n```\n// extra.js\nexport default \"https://myserver/justAnOther.js\"\n```\n\n```\n// vite.config.js\nimport { defineConfig } from 'vite'\n\nexport default defineConfig({\n build: {\n assetsInlineLimit: 0, // To avoid inline assets for PoC\n rollupOptions: {\n output: {\n format: \"cjs\"\n },\n },\n },\n base: \"./\",\n});\n```\n\nAfter running the build command, the developer will get following bundle\nas the output.\n\n```\n// dist/index-DDmIg9VD.js\n\"use strict\";const t=\"\"+(typeof document>\"u\"?require(\"url\").pathToFileURL(__dirname+\"/extra-BLVEx9Lb.js\").href:new URL(\"extra-BLVEx9Lb.js\",document.currentScript&&document.currentScript.src||document.baseURI).href);var e=document.createElement(\"script\");e.src=t;document.head.append(e);\n```\n\nAdding the Vite bundled script, `dist/index-DDmIg9VD.js`, as part of the\nweb page source code, the page could load the `extra.js` file from the\nattacker's domain, `attacker.controlled.server`. The attacker only needs\nto insert an `img` tag with the `name` attribute set to `currentScript`.\nThis can be done through a website's feature that allows users to embed\ncertain script-less HTML (e.g., markdown renderers, web email clients,\nforums) or via an HTML injection vulnerability in third-party JavaScript\nloaded on the page.\n\n```\n\n\n
\n