Skip to content
Heist/ feed
Unrated

Malicious code in analytics-widget (npm)

Type: advisorySource: OSV1 source record

--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (4b78f3ed716380da74c5d54de6e24b6b128536a7ce5772e8b05d03108a1d9b74) The package is published as 'analytics-widget' with an empty description, but its main module contains no analytics functionality. On load, index.js schedules a 2-second timer that reads the 'token' key from browser localStorage, falls back to a JSON serialization of the entire localStorage store if that key is missing, and POSTs the result to the relative endpoint '/addPost' via fetch. When bundled into a consumer's frontend, every end-user session that loads the page has their auth token (or the full localStorage contents) sent to whichever origin serves the bundle, enabling session hijacking of the consuming application's users. The package name and empty metadata serve as a cover story; no legitimate analytics code is present. ## Source: ghsa-malware (399579776689b5ab6b5fe78e2c79da4ddf4950f898e9017333bdadaf3603a7f3) Any 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.

Announced Source revision 1
Original source ↗

MAL-2026-17163

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:MAL-2026-17163

analytics-widget

Source reference: /affected/0/package/name

Affected versions
1.0.0

Source reference: /affected/0/versions

1.0.1

Source reference: /affected/0/versions

Fixed versions
Not stated in this record
Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          }
        ]
      }
    ],
    "package": {
      "name": "analytics-widget",
      "purl": "pkg:npm/analytics-widget",
      "ecosystem": "npm"
    },
    "versions": [
      "1.0.0",
      "1.0.1"
    ],
    "database_specific": {
      "cwes": [
        {
          "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",
          "cweId": "CWE-506",
          "description": "The product contains code that appears to be malicious in nature."
        }
      ],
      "source": "https://github.com/ossf/malicious-packages/blob/main/osv/malicious/npm/analytics-widget/MAL-2026-17163.json",
      "indicators": {
        "evidence_files": [
          {
            "path": "index.js",
            "tlsh": "69d02b93146a68019b79d9fa1cf1e03816354419b0ab48a02dd2848d1fceb0c53b60c8",
            "sha256": "775898de2fc58b3a5f8988282921e41803227599568a3840c86cb518501f7986"
          },
          {
            "path": "package.json",
            "tlsh": "94d0a7145a22943305c152620d1a8443b360cf5f10407c0c57cf581c42cf6b35dfa30c",
            "sha256": "99b436357d60930761c6dc23d536a0b458cc914ab042f8a3d8fedf393668728c"
          }
        ],
        "package_integrity": [
          {
            "hashes": {
              "sha1": "c1a7fbcca75159b1a8358ee195a42362e3b3afe9",
              "sha512_sri": "sha512-+ENqAVm/OQj2qYXMhxFcGWvdaAiXehSaLCHqLWFwpTAeiUiDJJ8byQ3LN7jrqxPsArRdnBwV/eCeolAQUbnCiw=="
            },
            "filename": "analytics-widget-1.0.0.tgz"
          }
        ]
      }
    }
  }
]

Publisher severity

No explicit severity was provided.

Event
#37010 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement