GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Version 5.6.1 published to npm is compromised (RESOLVED) · Issue #656 · chalk/chalk

Version 5.6.1 published to npm is compromised (RESOLVED) #656

New issue
Copy link
New issue
Copy link
Closed
Closed
Version 5.6.1 published to npm is compromised (RESOLVED)#656
Copy link

Description

@proton-ab
proton-ab
opened on Sep 8, 2025
Issue body actions

Same as debug-js/debug#1005

Malicious payload is on line 11 of src/index.js.

Reacted by Clément Pasteau, CupNoodleFork, darthmaim, Kashif Saadat, roman-causalens, Kane Wang, Jiri Spac, Jannis, Thomas Kaul, andy and 53 more
Reacted by gitDawn and Valentin Menoret
Reacted by Brian Kim, Mathieu Schroeter, Christian Torres A., Chainarong Tangsurakit, Shibam Biswas, dzheng113, Swapnil Soni, Alvaro Saburido, Vlad, Vinícius Teixeira and 5 more

Activity

Next
  1. jdstaerk commented on Sep 8, 2025

    @jdstaerk
    jdstaerk
    on Sep 8, 2025
    More actions

    It seems like all packages of the maintainer https://www.npmjs.com/~qix got hacked.

  2. mperotti22 commented on Sep 8, 2025

    @mperotti22
    mperotti22
    on Sep 8, 2025
    More actions

    A new version has been published to npm

  3. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    Please report to npm: https://docs.npmjs.com/reporting-malware-in-an-npm-package

  4. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    I have published over the compromised versions now:

    • https://github.com/chalk/chalk/releases/tag/v5.6.2
    • https://github.com/chalk/supports-hyperlinks/releases/tag/v4.1.2
    • https://github.com/chalk/chalk-template/releases/tag/v1.1.2
    • https://github.com/chalk/slice-ansi/releases/tag/v7.1.2
    • https://github.com/chalk/wrap-ansi/releases/tag/v9.0.2
    • https://github.com/chalk/has-ansi/releases/tag/v6.0.2
    • https://github.com/chalk/strip-ansi/releases/tag/v7.1.2
    • https://github.com/chalk/ansi-styles/releases/tag/v6.2.3
    • https://github.com/chalk/supports-color/releases/tag/v10.2.2
    • https://github.com/chalk/ansi-regex/releases/tag/v6.2.2

    They were available for approximately 2 hours.

    The compromised account has been removed from the packages.

    Update (08 Sep 2025 21:59 CEST): npm has finally taken down the infected versions: debug-js/debug#1005 (comment)


    Vulnerable versions:

    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    [email protected]
    
    Reacted by Jan-David Stärk, William Calderipe, Jannis, Ville-Veikka Kiiskilä, Vitalii Dub, Julien Roncaglia, Sam Vervaeck, simonmares, Horia Stoenescu, Shibam Biswas and 60 more
    Reacted by Kelvin | Aerosol, William Dias, tcme, Rafael Chicarelli, Peter Siebold, Dmirty, Manuel Spigolon, Robbie Pallas, Thanos Karagiannis, herrernst and 6 more
  5. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    For anyone curious, here's the malware: https://gist.github.com/sindresorhus/2b7466b1ec36376b8742dc711c24db20

    Reacted by Jannis, Eric Tyrrell, Caleb P. Burns, Emre Şafak, sbcinnovation, Roger C, maxlath, adam mcgreggor, Udbhav Gambhir, simonmares and 44 more
  6. jdstaerk commented on Sep 8, 2025

    @jdstaerk
    jdstaerk
    on Sep 8, 2025
    More actions

    I've written down how the malware works in case someone is interested: https://jdstaerk.substack.com/p/we-just-found-malicious-code-in-the

    Reacted by Astrid Soraya, Anderson L Polo A, Sindre Sorhus, Jannis, Emre Şafak, Logan, Myer, Martin Green, adam mcgreggor, Vitalii Dub and 47 more
    Reacted by Marc S. Brooks and Squirrel
  7. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    You can run the following to check if you have the malware in your dependency tree:

    rg -uu --max-columns=80 --glob '*.js' _0x112fa8 

    Requires ripgrep:

    brew install rg
    Reacted by Anderson L Polo A, Sung Jeon, Raí Siqueira, sbcinnovation, Patrick Harböck, João Moreno, Matt Hillsdon, Marek Litomisky, Isaac McFadyen, Vitalii Dub and 78 more
    Reacted by Kelvin | Aerosol, Julian, Nick Sergeant, Graeme George, Elia Pari, Damola Olutoke, Vincent Kielnhofer and Jozef Izso
  8. sindresorhus
    pinned this issue on Sep 8, 2025
  9. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    The "good" news, it’s a browser-only script.


    According to ChatGPT:

    This isn’t a “system” infection. It’s a browser-only script.

    What it does not do

    • No OS installs, no disk/filesystem access, no drivers/rootkits.
    • No keylogger or clipboard watcher in the code you shared.
    • No persistence by itself outside the browser context.

    What it does do

    • While it’s loaded in a page (or by an extension), it hooks your wallet provider and rewrites crypto addresses in network responses—so it can redirect funds or approvals you sign.
    • If it comes from a malicious extension or a site’s service worker/cache, it can re-run each session until you remove that source.
    Reacted by Kevin Deng, Chase Agee, phxgg, Telmo "Trooper", Lukas Diener, Ryan Lester, Alistair Smith, Christian Torres A., Marcia Ong, axi92 and 20 more
    Reacted by Casey Jones, Gamma91, Tobias Boehm, Deimantas Jakovlevas, nathan dawit, Thomas Dziedzic, Rob Burgess, Troy Whiteley, Fran Pavelić, Rico and 106 more
    Reacted by Dylan Myers, Thomas Dziedzic, Christian Torres A., Brad Dielman, Jeroen Cranendonk, Akshit Garg, Sambit Chakraborty, KazimirPodolski and Ashfaq Mahmood Rafi
  10. TomAFrench commented on Sep 8, 2025

    @TomAFrench
    TomAFrench
    on Sep 8, 2025
    More actions

    I have published over the compromised versions now

    npm is reporting the malicious versions as the latest release so it looks like these got unpublished.

  11. sindresorhus commented on Sep 8, 2025

    @sindresorhus
    sindresorhus
    on Sep 8, 2025
    Member
    More actions

    Full analysis by ChatGPT:


    This is a multi-chain “clipper + wallet-hijack” script. In plain English:

    What it does (high level)

    • If MetaMask (or another EIP-1193 provider) is present: it hooks window.ethereum.request/send/sendAsync and silently rewrites outgoing transactions so money/approvals go to the attacker.
    • If no Ethereum wallet is present: it rewrites HTTP responses (both fetch and XMLHttpRequest) to replace any crypto address it sees on the page with one of the attacker’s addresses (BTC, ETH, TRON, LTC, BCH, Solana, etc.).
    • It keeps counters and exposes window.stealthProxyControl so the operator can check whether the interceptor is active.

    The moving pieces (with effects)

    Entry / gating

    • checkethereumw() calls ethereum.request({method:"eth_accounts"}).

      • If accounts exist ⇒ runs runmask() (the wallet hook) and sets a flag neth=1.
      • In all cases it calls newdlocal() once (the network-response rewriter).

    HTTP response rewriter (newdlocal)

    • Overrides window.fetch and patches XMLHttpRequest so every response is run through _0x19ca67().

    • _0x19ca67() → _0x20669a() scans strings/JSON with regexes for addresses of:

      • Ethereum, Bitcoin (legacy + bech32), Tron, BCH, Litecoin (P2PKH + bech32), Solana (several prefixes).
    • For any detected address not in its baked-in allowlist, it replaces it with the “closest looking” attacker address using a Levenshtein distance function.

      • This “nearest look-alike” trick makes replacements harder to spot at a glance.
    • Special case: Ethereum addresses aren’t replaced if neth==1 (i.e., when a wallet is present), because the wallet hook below is a stronger attack path.

    Wallet hook (runmask)

    • Wraps provider methods and mutates request params before they’re sent:

      • eth_sendTransaction

        • If value is non-zero, it forces to = 0xFc4a4858bafef54D1b1d7697bfb5c52F4c166976 (attacker).

        • If data is present, it inspects function selectors and rewrites payloads:

          • 0x095ea7b3 (ERC-20 approve(address,uint256))
            → sets spender = attacker and value = 0xffff…ffff (max allowance).
          • 0xd505accf (EIP-2612 permit signature)
            → rewrites spender = attacker and value = max while preserving the rest (deadline, sig).
          • 0xa9059cbb (ERC-20 transfer(address,uint256))
            → forces to = attacker.
          • 0x23b872dd (ERC-20 transferFrom(address,address,uint256))
            → forces the recipient to attacker.
          • It also logs known DEX router addresses (Uniswap v2/v3, Pancake, 1inch, Sushi), but that’s just noise/telemetry.
      • solana_signTransaction / solana_signAndSendTransaction

        • Iterates instructions/keys and replaces every pubkey it finds with a constant 19111111111111111111111111111111 (malicious redirection / breakage).
    • Exposes stealthProxyControl with:

      • isActive(), getInterceptCount(), getOriginalMethods(), forceShield()—handy for the operator, suspicious on a site.

    Indicators of compromise (IoCs)

    • Primary ETH receiver: 0xFc4a4858bafef54D1b1d7697bfb5c52F4c166976

    • Huge hard-coded address lists for: ETH, BTC (1… + bc1…), TRON (T…), BCH (bitcoincash:), LTC (ltc1…, L…/M…), Solana (various prefixes).

    • Global names/patterns you can grep for in your codebase:

      • stealthProxyControl, runmask, newdlocal, checkethereumw, neth, loval, rund
      • Function selectors: 0x095ea7b3, 0xd505accf, 0xa9059cbb, 0x23b872dd
      • The long address arrays and the constant Solana pubkey 19111111111111111111111111111111.

    Why it’s effective

    • Network-layer replacement poisons any page content or API payload before your app sees it.
    • Wallet-layer hooking corrupts transactions at the last moment—even if your UI shows the right info—by mutating the provider call arguments preflight.
    • Levenshtein “nearest match” helps the swapped addresses look plausible.
    Reacted by Ryan Lester, Josef Budniakiewicz, Alistair Smith, Christian Torres A., Eric Kryski, Flamedek, baqueiro-aloi, Delweng, Martynas Skučas, Tixx7 and 5 more
    Reacted by TJ Horner, Akshansh Jaiswal, Tomáš Hübelbauer, Casey Jones, sbcinnovation, kienan, Gamma91, Tobias Boehm, Deimantas Jakovlevas, nathan dawit and 163 more
    Reacted by Andrey Bondarenko
    Reacted by Dylan Myers, Loominati, sbcinnovation, kienan, Logan Moore, Thomas Dziedzic, Thomas, Dexter Miguel, Sharon (Sean) Rolel, Christian Torres A. and 11 more
  12. Sytten commented on Sep 8, 2025

    @Sytten
    Sytten
    on Sep 8, 2025
    More actions

    Colors was just published (https://www.npmjs.com/package/color/v/5.0.1), might be compromised too

  13. BitR13x commented on Sep 8, 2025

    @BitR13x
    BitR13x
    on Sep 8, 2025
    More actions

    Extracted from the obfuscated script few blockchain address:

    0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af
    0x10ed43c718714eb63d5aa57b78b54704e256024e
    0x13f4ea83d0bd40e75c8222255bc855a974568dd4
    0x1111111254eeb25477b68fb85ed929f73a960582
    0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f
    

    you can take a look at them at https://www.blockchain.com/

    Reacted by sbcinnovation, Wylie Fowler, umrc and Moshe Schnitzler
  14. AdnaneKhan commented on Sep 8, 2025

    @AdnaneKhan
    AdnaneKhan
    on Sep 8, 2025
    More actions

    Extracted from the obfuscated script few blockchain address:

    0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af
    0x10ed43c718714eb63d5aa57b78b54704e256024e
    0x13f4ea83d0bd40e75c8222255bc855a974568dd4
    0x1111111254eeb25477b68fb85ed929f73a960582
    0xd9e1ce17f2641f24ae83637ab66a2cca9c378b9f
    

    you can take a look at them at https://www.blockchain.com/

    Those are swap contract addresses, not attacker addresses. E.g. 0x66a9893cC07D91D95644AEDD05D03f95e1dBA8Af the Uniswap v4 universal router addr.

    Every indication so far is that the attacker stole $0 from all of this. Which is a best-case outcome.

    Reacted by Appie, Sam Vervaeck, Christian Torres A., Eric Kryski, Corbin Crutchley (Work), Parker Rowe, jacobmoshipco, André Fatia, k0ns0l, Stefan and 9 more
  15. kanadgupta
    added a commit that references this issue on Sep 8, 2025

    chore(deps): bump (#1343)

    e5a8574
  16. 23 remaining items

  17. fz6m commented on Sep 8, 2025

    @fz6m
    fz6m
    on Sep 8, 2025
    More actions

    For those curious, here’s the phishing email I received:

    1. It was already flagged and placed in Gmail’s spam folder.

    2. Clicking the link triggered an additional Gmail warning about a dangerous site (which reminded me to double-check the sender address).

    Image
    Reacted by kiranblackduck
    Reacted by Lakshan Perera
    Reacted by Ruy Rocha, Mitu Sergiu and Swapnil Soni
    Reacted by Utkarsh Kumar Raut, ..., Swapnil Soni and Yash Jawale
  18. ruyrocha commented on Sep 9, 2025

    @ruyrocha
    ruyrocha
    on Sep 9, 2025
    More actions

    For those curious, here’s the phishing email I received:

    1. It was already flagged and placed in Gmail’s spam folder.
    2. Clicking the link triggered an additional Gmail warning about a dangerous site (which reminded me to double-check the sender address).
    Image

    that's beautiful :) from now on, looks like all emails will be properly flagged as SPAM as the aforementioned domain name returns as non-existent.

  19. justusjonas74
    added a commit that references this issue on Sep 9, 2025

    Fixing chalk/chalk#656

    7ac9fec
  20. Hypfer commented on Sep 9, 2025

    @Hypfer
    Hypfer
    on Sep 9, 2025
    More actions

    @sindresorhus

    While AI can evidently be very useful at processing such obfuscated things, I highly recommend not taking whatever it says at face value, but just as a pointer to then verify what it says on your own.

    These systems are anything but unfailable and you can be sure that in the future, we will see attacks that are hardened against LLM analysis e.g., by being structured in a way specifically crafted to completely mislead the LLM and give you a wrong analysis.
    One term for googling there would be "adversarial noise", but I am not an expert, so I bet there are better/more fitting terms to look out for.

    Which isn't to say that the analysis isn't useful. It is very useful, since it is a lot quicker than any human analysis could be. All it would need would be framing.

    Something like opening not just with "ChatGPT says this" but "Here's a possibly incorrect preliminary analysis", showing awareness of its limitations.

    Another thing that could be done to improve "possibly true" chances would be to let all the major LLMs do it and see if they agree.
    Fooling all of them might at least be harder than just fooling one of them.

    Reacted by Lee Crosby, Thomas van de Put, Andrey Bondarenko and Claude M.
    Reacted by KnorpelSenf, Adam Czogallik, Manoj Chandrashekar, bre1470, Jacob Żyworonek, Rafał Goławski, Tom Perry-Schafer, Stefan Linke, André Douverny, herrernst and 20 more
  21. sindresorhus
    changed the title [-]Version 5.6.1 published to npm is compromised[/-] [+]Version 5.6.1 published to npm is compromised (RESOLVED)[/+] on Sep 9, 2025
  22. Fikralaksana commented on Sep 9, 2025

    @Fikralaksana
    Fikralaksana
    on Sep 9, 2025
    More actions

    I read the de-obfuscated malware code.
    I see it is overriding any fetch response that match with regex pattern.

    So there are possibilities where:
    Any API response with the similar pattern with regex criteria (not only wallet address) got replaced. Then it will break your applications.
    CMIIW

  23. KazimirPodolski commented on Sep 9, 2025

    @KazimirPodolski
    KazimirPodolski
    on Sep 9, 2025
    More actions

    @sindresorhus It is extremely sad to see such a massively sponsored opensource contributer to unironically take advice from a chatbot, and apparently seeing nothing wrong with it.

    Do I have to replace now every remotely runtime-affecting piece of software you have touched?

    Reacted by lukebatchelor, Pablo, Sören Beye, Dennis Bruijn and SurDaft - Jack Stupple
    Reacted by Andrey Bondarenko and Sergiy Kozyr
  24. shaman007 commented on Sep 9, 2025

    @shaman007
    shaman007
    on Sep 9, 2025
    More actions

    "According to ChatGPT". We are doomed. Doomed!

    Reacted by Jakov Čiček and Dennis Bruijn
    Reacted by KazimirPodolski and Rodrigo Gross López
  25. alex7kom commented on Sep 9, 2025

    @alex7kom
    alex7kom
    on Sep 9, 2025
    More actions

    I don't really want this discussion to derail into another AI flame war. You should give other people here the benefit of the doubt. We are in a tech community, and I'd assume most of us understand the limitations of LLMs without needing to prefix every single LLM copypaste with a lengthy disclaimer about their unreliability.

    Reacted by Andrey Bondarenko and SurDaft - Jack Stupple
  26. Hypfer commented on Sep 9, 2025

    @Hypfer
    Hypfer
    on Sep 9, 2025
    More actions

    @alex7kom

    I do not believe that it is a good idea to react to one extreme with another.
    Even though the intentions surely are good, we're not doing us any favors if we skew reality to defend against another "side" that skews reality.

    Obviously, the dunking is completely unproductive and highly disrespectful. If you don't trust Sindres judgement, don't use his software. You do not need to tell him that this dismissively in his face.
    That serves no purpose other than causing hurt and that is simply unwarranted.

    There was this attempt to somehow construct a reason why actually it's okay to do so because "massively sponsored", but that's simply bogus and just something one came up after the fact to somehow frame their actions as right.

    But to reject that, we do not need to reject reality.
    To quote gemini :^)

    Why it's unproductive (despite seeming reasonable):
    It Ignores Evidence: The core of his argument is "I'd assume most of us understand the limitations." This is demonstrably false. The hundreds of downvotes on Sindre's posts are direct evidence that the community did not agree and felt a disclaimer was necessary.
    It Invalidates the Concern: By framing the disagreement as just "another AI flame war," he minimizes the legitimate, specific security concerns that people have. He's essentially telling one side that their worries are just generic, annoying noise.

    And to add my own point beyond that

    without needing to prefix every single LLM copypaste with a lengthy disclaimer about their unreliability

    that's just a strawman and a false dichotomy at the same time.
    No one requested that and in fact I even provided a specific sentence that would get the job done with like 3 more words.


    I believe the underlying issue is that "relying too much on AI" is seen as a moral failing.
    This can be seen in the offense, but it can also be seen in the defense that rejects the offense and claims that "for sure everything must be right" - meaning that the idea of it being a "moral failing" still is in place; it just didn't happen.

    The solution to that is to take away that framing and just look at things at face value.
    That is what I tried to do and that is what I'd like us all to do.

    Why take away from this opportunity to learn something interacting as equals?

  27. sindresorhus commented on Sep 9, 2025

    @sindresorhus
    sindresorhus
    on Sep 9, 2025
    Member
    More actions

    I simply used AI to get a preliminary analysis before humans had time to review it fully (I'm sure all the security labs do it these days too). I see nothing wrong with that. I labeled it as AI so people can decide whether to trust it or not.

  28. sindresorhus commented on Sep 9, 2025

    @sindresorhus
    sindresorhus
    on Sep 9, 2025
    Member
    More actions

    Locking this now as the issue has been resolved and the discussion is no longer productive.

  29. chalk
    locked as resolved and limited conversation to collaborators on Sep 9, 2025
  30. sindresorhus
    closed this as completedon Oct 1, 2025
  31. sindresorhus
    unpinned this issue on Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.