MAL-2026-5481Malicious code in mcp-server-postgres (npm)
| Ecosystem | Package | Version |
|---|---|---|
| npm | mcp-server-postgres | * |
| npm | mcp-server-postgres | 0.0.1 |
| npm | mcp-server-postgres | 0.0.2 |
{"schema_version":"1.7.4","id":"MAL-2026-5481","published":"2026-06-09T20:34:49Z","modified":"2026-08-20T15:28:05.313079640Z","aliases":["GHSA-vm2g-qj5x-x234"],"summary":"Malicious code in mcp-server-postgres (npm)","details":"\n---\n_-= Per source details. Do not edit below this line.=-_\n\n## Source: amazon-inspector (f0b86cc4cf49b5d6cda37126f6a0c7c9f9fec648eb4d4743b6f39423613d3122)\nPackage squats the unscoped name `mcp-server-postgres` (impersonating the official scoped MCP postgres server). package.json declares `\"postinstall\": \"node index.js\"`, which fires unconditionally on `npm install`. index.js loads `os`, `https`, and `http`, then POSTs a JSON body containing `os.hostname()`, `process.cwd()`, the npm user-agent, Node version, and `os.platform()` to a hardcoded Cloudflare Workers endpoint at `https://npx-canary-log.vulnerable-live.workers.dev/log`. Installers and CI systems running `npm install` or `npx mcp-server-postgres` leak host identifiers and working-directory paths to a third-party endpoint without consent. Although the author self-describes the package as a 'canary' for npx-confusion research, the typosquat name combined with unsolicited install-time host telemetry exfiltration constitutes a supply-chain attack against installers.\n\n## Source: ghsa-malware (205ca5db960964529f7a10a5683d5caef078ad5092ca98abf859a8121bede417)\nAny computer that has this package installed or running should be considered fully compromised. All secrets and keys stored on that computer should be rotated immediately from a different computer. The package should be removed, but as full control of the computer may have been given to an outside entity, there is no guarantee that removing the package will remove all malicious software resulting from installing it.\n","affected":[{"package":{"name":"mcp-server-postgres","ecosystem":"npm"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"}]}],"versions":["0.0.1","0.0.2"],"database_specific":{"cwes":[{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"},{"cweId":"CWE-506","description":"The product contains code that appears to be malicious in nature.","name":"Embedded Malicious Code"}],"indicators":{"domains":["npx-canary-log.vulnerable-live.workers.dev"],"evidence_files":[{"path":"index.js","sha256":"7e44b21be634b28a9772004faf455a933349127afe559353d0e7e61dccdbbb7b","tlsh":"6c3195e180f805351fee46d3e2e9a899a36ff126360778f0b49e02295fc90980771cd2"}],"package_integrity":[{"filename":"mcp-server-postgres-0.0.1.tgz","hashes":{"sha1":"619d5e7a8cf71d7cbf29b260f406442286c4935f","sha512_sri":"sha512-IxhzDulWucT/bRAY4fo07EpNfusWdSz1iCwmawMrlUeIJXbovHCwDa8qq04xY2w8EYWvE/SjiCIbyl6PuqVS2Q=="}}]}}}],"references":[{"type":"PACKAGE","url":"https://www.npmjs.com/package/mcp-server-postgres/v/0.0.1"},{"type":"PACKAGE","url":"https://www.npmjs.com/package/mcp-server-postgres/v/0.0.2"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-vm2g-qj5x-x234"}],"database_specific":{"malicious-packages-origins":[{"id":"IN-MAL-2026-005231","import_time":"2026-06-09T20:45:57.509546196Z","modified_time":"2026-06-09T20:34:49Z","sha256":"6c4d1fa0d6fdf2966637bf91c161f3c063aa675eeca88bd0f9abf002c51070c6","source":"amazon-inspector","versions":["0.0.1"]},{"id":"IN-MAL-2026-005232","import_time":"2026-06-09T20:45:57.599849438Z","modified_time":"2026-06-09T20:34:50Z","sha256":"ee78fcc5f02c57d736d4788fc916c776b9db61a18edad8291254ad697763f597","source":"amazon-inspector","versions":["0.0.1"]},{"id":"IN-MAL-2026-006022","import_time":"2026-06-12T19:43:59.235102535Z","modified_time":"2026-06-12T19:07:29Z","sha256":"083002f0c966dc86b847b4a40733a705c82249bbdad0d7f3fef8861f58f983f1","source":"amazon-inspector","versions":["0.0.2"]},{"id":"IN-MAL-2026-006019","import_time":"2026-06-12T19:43:58.903981438Z","modified_time":"2026-06-12T19:07:27Z","sha256":"f0b86cc4cf49b5d6cda37126f6a0c7c9f9fec648eb4d4743b6f39423613d3122","source":"amazon-inspector","versions":["0.0.2"]},{"id":"GHSA-vm2g-qj5x-x234","import_time":"2026-08-20T15:26:15.543163865Z","modified_time":"2026-08-20T14:25:56Z","ranges":[{"events":[{"introduced":"0"}],"type":"SEMVER"}],"sha256":"205ca5db960964529f7a10a5683d5caef078ad5092ca98abf859a8121bede417","source":"ghsa-malware"}]},"credits":[{"name":"Amazon Inspector","contact":["inspector-research@amazon.com"],"type":"FINDER"}]}数据来源:OpenSSF Malicious Packages · Apache-2.0