Largest NPM Compromise in History - Supply Chain Attack
Posted by Advocatemack@reddit | programming | View on Reddit | 587 comments
Hey Everyone
We just discovered that around 1 hour ago packages with a total of 2 billion weekly downloads on npm were compromised all belonging to one developer https://www.npmjs.com/\~qix
ansi-styles (371.41m downloads per week)
debug (357.6m downloads per week)
backslash (0.26m downloads per week)
chalk-template (3.9m downloads per week)
supports-hyperlinks (19.2m downloads per week)
has-ansi (12.1m downloads per week)
simple-swizzle (26.26m downloads per week)
color-string (27.48m downloads per week)
error-ex (47.17m downloads per week)
color-name (191.71m downloads per week)
is-arrayish (73.8m downloads per week)
slice-ansi (59.8m downloads per week)
color-convert (193.5m downloads per week)
wrap-ansi (197.99m downloads per week)
ansi-regex (243.64m downloads per week)
supports-color (287.1m downloads per week)
strip-ansi (261.17m downloads per week)
chalk (299.99m downloads per week)
The compromises all stem from a core developers NPM account getting taken over from a phishing campaign
The malware itself, luckily, looks like its mostly intrested in crypto at the moment so its impact is smaller than if they had installed a backdoor for example.
How the Malware Works (Step by Step)
- Injects itself into the browser
- Hooks core functions like
fetch
,XMLHttpRequest
, and wallet APIs (window.ethereum
, Solana, etc.). - Ensures it can intercept both web traffic and wallet activity.
- Watches for sensitive data
- Scans network responses and transaction payloads for anything that looks like a wallet address or transfer.
- Recognizes multiple formats across Ethereum, Bitcoin, Solana, Tron, Litecoin, and Bitcoin Cash.
- Rewrites the targets
- Replaces the legitimate destination with an attacker-controlled address.
- Uses “lookalike” addresses (via string-matching) to make swaps less obvious.
- Hijacks transactions before they’re signed
- Alters Ethereum and Solana transaction parameters (e.g., recipients, approvals, allowances).
- Even if the UI looks correct, the signed transaction routes funds to the attacker.
- Stays stealthy
- If a crypto wallet is detected, it avoids obvious swaps in the UI to reduce suspicion.
- Keeps silent hooks running in the background to capture and alter real transactions
Our blog is being dynamically updated - https://www.aikido.dev/blog/npm-debug-and-chalk-packages-compromised
Haplo12345@reddit
Ah yes, crypto... continuously proving that it is great for one thing: cyber crime.
AvailableTie6834@reddit
interesting, criminals prefer dollars over crypto, usually because you cannot trace dollar bills, but you can trace every single bitcoin transaction or any crypto that has it blockchain public. huh.
Haplo12345@reddit
It's pretty hard to get payment from someone overseas when demand payment in cash.
Dollar bills are also traceable--each bill has a unique serial number.
AvailableTie6834@reddit
good luck tracing dollar bills
Haplo12345@reddit
I mean the US government and Fed have a fine time doing it. They've been doing it for like a century at this point.
AvailableTie6834@reddit
too bad they doesnt seem to catch many criminals with their tactics.
Haplo12345@reddit
They catch plenty of criminals that way.
AvailableTie6834@reddit
imagine using a 100% traceable currency that is open to the public to perform big criminal activities.
roscoelee@reddit
Hold on. Do I understand this correctly? It watched for crypto wallets and inserts its own wallet address in place of the targets? Is it really that easy to steal cryptocurrency? How does anything think crypto is a viable alternative if that is the case?
grauenwolf@reddit
This is just one of many, many ways to steal crypto. There's virtually no way to interact with it directly in a safe manner.
reb0rn21@reddit
You are still free to use bank, bitcoin is just alternative, and if you do not look at the address you send to, well you are your own bank and those should take more care
grauenwolf@reddit
Bitcoin is just alternative that's driving up my electricity bill, polluting the environment, adding system risk to the financial sector, ...
reb0rn21@reddit
This has nothing with gambling one day you will learn, now you keep living a cave
grauenwolf@reddit
I really wish you assholes would stop pretending that blockchain is some futuristic technology. It's basically a really inefficient hash chain, and those were well understood by the 1980s.
reb0rn21@reddit
name calling just show your true IQ
grauenwolf@reddit
My frustration with your dishonest behavior doesn't change the fact that your behavior is dishonest.
EZGGWP@reddit
The tools that allow you to verify the validity of smart contracts, addresses and other things are improving. If you're dumb and ignorant as a rock, then yes, your funds will be stolen. I imagine there were a lot of issues with first iterations of online banking, too. As other mentioned, there is no central authority in blockchains, which is a blessing and a curse. It's a trade-off, nothing more, nothing less. I personally paid for many things with crypto and I wasn't scammed out of my money. There are people who are scammed out of tens of thousands of dollars through normal banking. The issue is human factor.
Sandor_at_the_Zoo@reddit
yeah, what sort of dumb and ignorant as a rock person would, checks thread we're in ever have installed a node package that used a different, widely used node package to handle styling of terminal strings. Surely someone as incompetent as that deserves to have their life savings disappear.
EZGGWP@reddit
The comment I replied to wasn't talking about this particular way of crypto safety issues. It was talking about it in a broader sense.
Because the attack vector we are currently talking about isn't related to crypto in any way other than what the malicious code is doing, which is hijacking Chrome extensions, which are pretty shit in general, safety wise. If your code base is compromised, you may lose funds even in a normal banking system.
grauenwolf@reddit
Again, it is related to crypto. If the same attack was done against me, I would call my bank and have them revert all of the charges.
Heck, they bank would probably pre-emptively block the charges when they saw a whole bunch of unexpected transactions from unrelated people all going to the same handful of accounts.
And those accounts would be, at least in theory, registered to real people who had to show ID.
grauenwolf@reddit
I wish I could give you all the upvotes I got in this thread because you are pointing to the elephant in the room that everyone else including myself was ignoring.
grauenwolf@reddit
One of the problems in crypto currency is the mistaken belief that you can use tools to verify the validity of smart contracts.
But I don't recall anyone claiming that tools can verify addresses because addresses are not uniquely linked to people. Isn't like you get an SSL certificate when you get an address.
EZGGWP@reddit
Your lack of experience with blockchains shows. You can use tools (explorers) to verify the validity of smart contracts (via security audits performed by specialized entities). There is no tool that can scan smart contract code and tell us if it is malicious or not, that's true. But such a thing can not exist.
It's interesting that you used SSL as an example since certificate based security relies heavily on trust (one of the biggest authorities is literally Google Trust Services). Blockchain industry already has multiple well-known "authorities" that simplify checking the validity of contracts, some addresses, and other miscelaneous stuff. Such big entities are about as likely to turn malicious as Google Trust Services leaking their private keys to bad actors.
If you apply the same principles to crypto as you do to your bank account, that is - not leaking your password or 2FA - your funds will be safe. If you check the address to which you send tour funds - the same way you check an IBAN when making a transfer - your money will not go to the wrong person.
grauenwolf@reddit
EZGGWP@reddit
There was a news article about how a finance worker was scammed through a deepfaked video call. $25m lost. People lose money for many reasons every day.
And don't pretend like there are no bugs in software outside blockchain. Yes, blockchain has a lot of exploits, many of which sprout from it's questionable legality, subpar popularity, and high complexity paired with relatively sparse number of expert developers. It is not a great point to use to consider it a worse industry.
fishling@reddit
u/grauenwolf isn't disputing that humans can fall for scams via social engineering or AI fakes. So, you're not countering actually their point here.
They are challenging YOUR assertions in your last paragraph:
They posted several responses proving you are plainly wrong here AND that audits and reviews aren't sufficient.
EZGGWP@reddit
Nothing is sufficient until human factor exists. This NPM phishing accident is the best proof there is: however skilled and knowledgable a person is, however many auth factors there is, mistakes will be made and damage will be done.
My points still stand: there were no major issues with USDT exploits that were based on the nature of the blockchain. They were caused by negligence or mistakes made by third parties.
Most examples that grauen provided are far from major players. Typical USDT users wouldn't be affected by these vulnerabilities. So they are about the same as some startup on stock market that went out of business but investor money were already offshore on Marshall islands.
These things happen. They happened to our economy a lot when it was cash-oriented. Once computerization and regulation took place, number of these cases reduced. Blockchain is early in its life still.
fishling@reddit
Of course human factors are going to be relevant in phishing attacks. That's part of the definition.
Actually, this is a much narrower point than you were arguing earlier, based on the words you actually used, which was a much broader stance that anyone using 2FA and keeping their credentials safe and not falling for phishing attacks was completely immune to losing any currency, ever. "Nature of the blockchain" excludes things like smart contract exploits or defects in the software.
This is a major shift in your position. You didn't say "niche players are vulnerable". Your position was "only idiots are vulnerable and it's by negligence on their own part".
grauenwolf@reddit
I have to wonder what a "major player" is in their mind when only one of my examples had less than a million dollars in losses.
grauenwolf@reddit
Oh you really don't want to open that can of worms. It is widely known that USDT/Tether is a fraud and they don't have anywhere near the amount of assets they claim to have in their accounts.
Why do you think there's never been an audit of the company's financials? If there were, the entire scheme would collapse and cause immense amount of collateral damage.
That said, it's only a matter of time before some AG gets a wild hair and and forces Tether to open their books.
fishling@reddit
That guy will just continue move the goalposts.
grauenwolf@reddit
To some degree I feel bad for them. Crypto made a lot of promises after the 2008 crash.
It's like being promised a socialist utopia, but getting a weird mix of communism and end-state capitalism instead. And being so invested, they can't just walk away. So they scramble for something to cling to.
fishling@reddit
I guess, but on the other hand, maybe they shouldn't make crypto such a big part of their identity that they can't be rational or objective about it. :-)
grauenwolf@reddit
And then what happened?
The thing about Bank transfers is they can usually be reversed. And bank accounts usually require ID to open in the first place. All these are not perfect, they add layers of protection that you don't have with blockchain.
EZGGWP@reddit
Funds probably returned, fee of thousands of dollars for a simple tranfser was probably kept by the bank (for, putting it simply, moving numbers from one bank account to the other in a computer system). A trade-off, as I said.
gefahr@reddit
No one is paying their bank a % of the transfer amount for a wire. In US banks for personal accounts, a wire transfer has a $0-35 fee.
(I'm less familiar with European bank fee structures but I'm sure a dozen of them will be along to tell me how antiquated US banks are any moment, and one of them can tell us.)
grauenwolf@reddit
Last I checked, wire transfers for businesses were free. Which makes sense because they don't want to lose a customer with a lot of cash in their vault.
grauenwolf@reddit
If you too want to laugh at 's ignorance, or crypto in general, check out https://www.web3isgoinggreat.com/
The amount of lost and stolen crypto currency is over 79 billing dollars.
BadGraaphics@reddit
Ignorance about what? You've pointed out that a new technology has flaws, congrats. He pointed out that it has the potential to be fixed and used safely. Neither of you are wrong, so why are you dunking on him over nothing?
grauenwolf@reddit
Blockchain is not a new technology. If you have to resort to obvious lies to defend position your position is bad.
BadGraaphics@reddit
Blockchain as it is being used now is far more complex than how it was used in 2009. Bitcoin uses a proof-of-work model which is very energy intensive and inefficient. Solana (just as an example, there are other models) in contrast uses a proof-of-stake and proof-of-history model which makes transactions cheaper, more energy efficient, and faster, at the cost of a higher degree of centralization. These technological improvements have allowed for significantly more complex products and tools to be developed.
You're needlessly aggressive about something you seem to know little about.
grauenwolf@reddit
I know a lot about the topic. You're the one who apparently doesn't because you still think that these problems could be fixed even though they are fundamental to the design.
Why are you talking about proof of stake? That has an absolutely nothing to do with the security vulnerabilities of blockchain technology that we're talking about.
Actually I know why. You trying to change the topic of conversation because you know you're going to lose on security every single time.
It should also be noted that all of the smart contract problems existed before ethereum went to proof of stake. So it was in no way in enabler for all of those advanced products that are causing so many additional problems.
BadGraaphics@reddit
I brought up proof-of-stake to give an example of how blockchain as a technology has evolved since 2009.
I'm not trying to change the topic as you so aggressively put, I'm responding to you claiming blockchain isn't a new technology - which, again, I don't entirely disagree with as proof-of-work is older, while proof-of-stake and other models are newer.
I don't know why you are so aggressive and combative in all your responses.
In my opinion, there is nothing inherently wrong with blockchain technologies. They are implemented successfully at private scales all the time. Furthermore, it's probably the closest thing we have to a zero-trust system that functions at a large scale.
In your opinion, how are these "smart contract problems" you mention mitigated via other software, and what makes that "impossible" to do via a blockchain?
stormdelta@reddit
Because we're sick to death of disingenuous posters continuing to make excuses, especially as you're years past any plausible deniability of arguing in good faith.
A "private blockchain" that makes any sense is basically just a distributed merkle tree or hash chain, and are really a completely different thing than cryptocurrencies in terms of security implications and tradeoffs made.
grauenwolf@reddit
I am aggressively against blockchain technology because it is universally a scam, or rather a collection of different scams piled up on top of each other. It has no useful purpose other than to make it easier to commit various forms of fraud and money laundering.
Furthermore it, it has been an environmental disaster causing unknown billions in waste. I'm talking about both electricity and hardware costs, but there's probably substantial amount of public and corporate money wasted on blockchain projects as well.
And I'm especially sick of all the excuses such as claiming it's a "new technology". Proof of Stake dates back to 2012, so I don't want to hear it again unless you can explain how it addresses the fundemental security issues.
BadGraaphics@reddit
I can't agree that it is universally a scam - it's used in supply chain management at a private level quite effectively. It feels like you're lumping cryptocurrency and blockchain technology together into one, which imo isn't fair to the technology at all. I agree that cryptocurrency has, almost universally, been a "scam".
(I use scam lightly as I believe the majority of people who "invested" into cryptos knew the volatility of the "assets" they were buying. Teams that made a good faith effort to run misguided projects are just failed entrepreneurs, in opposition to genuine scammers who were rampant. But I digress)
Proof-of-work WAS and IS an environmental disaster I completely agree. There is so much wasted energy being used frivolously. Solana is more efficient energy wise than VISA. I think that says enough about how much the technology itself has improved over even a short period of time (2012 to now, if we're talking about proof-of-stake)
You also didn't answer how blockchain technology has security problems inherent to it that can't be solved via better engineered software (or smart contracts) the same way we solve security problems in other areas of distributed computing, consensus mechanisms, and financial infrastructure.
grauenwolf@reddit
No it's not. There is literally no use case for blockchain in supply chain management.
It doesn't even make sense in supply chain management. The security guarantees of blockchain only exist if you have an open database where everyone can see every transaction and anyone can calculate the next box. This is not something that companies want. Those systems are run as private blockchains with one organization maintaining the database of record, meaning they offer no more protection than a normal hash chain.
Furthermore, recording transactions was already a solved problem. The difficulty in supply chain management is proving the contents of the shipping container have not changed. And no database can do that.
At best blockchain was used as an excuse to get funding for normal database improvements they wanted to do anyways. At worst it was a complete scam and no meaningful software was ever delivered.
How many times do I have to repeat myself? Transactions cannot be rolled back. This isn't something that you can 'solve' because it's a fundamental feature of the technology.
EZGGWP@reddit
Do you know how much money is lost to corruption? And corruption money often come from working people's taxes. These crypto losses are mostly gamblers' and commercial investors' money, mixed with some poor souls' attempts to earn money through investment. You can lose huge amounts of money on stock market as well.
I swear to god, you people just need a scapegoat to laugh at. All while modern world's economy is in poor state, yet CEOs and directors get hundreds of millions in annual bonuses.
grauenwolf@reddit
I've heard all of these excuses before. They didn't impress me then and they don't impress me now. Blockchain is a fundamentally insecure platform for financial transactions. All of your complaints about corruption in other Industries doesn't change the fact that blockchain is a fundamentally insecure platform.
EZGGWP@reddit
They are not excuses, they are facts, context if you will. Blockchains are imperfect, but so is everything else. It is true that current blockchains are not ready for use by normies and elderly and generally technologically illiterate people. Regardless of that fact, there are some parts of it that work very well. I had 0 problems with USDT payments, and I've made dozens of transactions with USDT. Ranging from paying for digital goods all the way to paying for a GPU on Newegg.
There are good things about blockchain, there are bad ones. Just like the usual banking system that controls your every payment and can be a horrible tool in the hands of a stupid government.
Agree to disagree, I guess. You seem to see blockchains only as a joke, while I have actual experience working with it, studying it, and using it. I don't believe there is a short way for me to at least try to change your mind, especially considering that you don't seem to even want to change your own mind on that topic. On that note, I'm out of the discussion.
grauenwolf@reddit
As a software engineer I actually do have experience working with blockchains. Unfortunately it mostly involves reviewing blockchain databases and explaining why they are utterly stupid by going through all of their deficiencies point by point.
I won't bother you enumerating them because they tend to be specific to the implementation. So I will say the common theme is that most blockchain databases are really just mongodb databases with a blockchain based log duct taped to the side for marketing purposes.
I have yet to see a legitimate use of blockchain technology anywhere. In the few cases they even got close, the actual answer was a hash chain.
grauenwolf@reddit
Your personal experiences with have no bearing on this conversation. I could cite the fact that one of my friends is now homeless in part because she lost a lot of money to a cryptocurrency scan. But that wouldn't be relevant either.
What is relevant is the fundamental flaws of the technology. For example, the inability to reverse fraudulent transactions. Regardless of how many times you successfully bought drugs without getting caught using crypto, it doesn't change the fact that fraudulent transactions can't be reversed.
Another thing that's irrelevant to this conversation is the fact that the primary use case right now in the US seems to be money laundering. More specifically, it is being used to bribe the president of the United States.
But again, we're talking about security. And if this was a normal scam using wire transfers, they could Blacklist all of the accounts being used to receive the stolen funds. That's not an option for cryptocurrencies, so money is continuing to flow into those fraudulent accounts.
grauenwolf@reddit
Members of the Penpie team filed complaints with Singaporean police and the US FBI. They also attempted to negotiate a "bug bounty" via on-chain and social media messages to the attacker, but the hacker seems uninterested and has continued to transfer funds between various crypto wallets and launder funds through Tornado Cash.
grauenwolf@reddit
grauenwolf@reddit
grauenwolf@reddit
stormdelta@reddit
Victim blaming isn't a security model, particularly when requiring inhuman perfection to use safely, and which fails irrevocably and catastrophically if any mistake is made. We're talking about requiring a level of opsec even experts screw up, much less regular people, with zero fallback or recovery.
Trade-off yes, but such an extreme and severe one that the genuine applications are largely illegal transactions in order to bypass otherwise better systems that have more oversight. And sure, illegal doesn't mean unethical, but that's the only relevant niche they provide real utility in over other options.
The relative risk profile is worlds apart, and it's incredibly disingenuous to pretend otherwise.
EZGGWP@reddit
Victim blaming is not a security model, it's a statement of what actually happened. As I said, there are tools and practices used by many players jn the industry that help avoid getting scammed. And yet, people still grt scammed. If a normal person was threatened to withdraw cash and give it to the bad actor, normal banking system wouldn't be able to do much either. Financial safety takes away freedom, and blockchain had freedom in mind since its first inception. If you don't like the trade-off, you're welcome to not use it.
The person I initially replied to talked about trust, and I drew a parallel with the SSL/TLS system. It's also built on trust. There may be more accountability among normal organizations, but when shit hits the fan, they will pay the fees and be on with their life, while you, having suffered the consequences, will have to either go to court with them, or suck it up. Court shennanigans are not always worth it.
Afterword, USDT is a very safe token to use. The minting organization keeps big records on those who abuse crypto and their blacklists are very long. It doesn't fully protect you from losing money, but it sure as hell reduces the amount of stolen money on blockchain.
roscoelee@reddit
SSL uses a central certificate issuing authority for establishing trust. Almost like a certificate bank if you will.
grauenwolf@reddit
Yes, but it takes crypto to make millions of dollars a regular occurrence. https://www.web3isgoinggreat.com/
Beneficial_Slide_424@reddit
Hardware wallets (cold wallet) using auditable open source firmware exists. It is supposed to protect your funds even if your computer is hacked, as long as you verify the address / the amount send on the display before physically confirming the transaction.
https://github.com/BitBoxSwiss/bitbox02-firmware
stormdelta@reddit
The vast majority of people aren't capable of realistically auditing it, so they're back to trusting the word of people they don't know.
If anything happens to the hardware wallet, they've lost access. If they kept backups outside the wallet, those can be compromised. In both cases there is zero chance of recovery.
And that's not even getting into how the key generation process might be found to have flaws later, or all the other myriad forms of human error that all result in catastrophic, irrevocable loss.
Yes, these things happen in conventional finance too, but the difference is there is no pretense that they can't. We have laws and processes to recover funds, reverse fraudulent transactions, etc.
Beneficial_Slide_424@reddit
This comment exposes the lack on information you have on public-key cryptography. The transactions are signed and sent out of the device, even if everything else is compromised, they can not fabricate a transaction using your identity, as it would require breaking ECDSA (Specificially, curve SECP256K1), which reduces to solving Elliptic Curve Discrete Logarithm Problem, and best known attacks take 2\^128 operations. No known hardware can come close to solving it.
Have you ever written an implementation for any cryptography algorithm? I implemented SECP256K1 curve myself on low level languages. All you need is to generate random 32 bytes then use ec_scalar_mul to compute the corresponding public key. There is no complicated process and common pitfalls compared to RSA, and you can simply generate it by rolling a hex dice 64 times. All operating systems have secure random generators, and today mostly hardware provided entropy is used, i.e, TPM (see TPM_CC_GetRandom). The outputs can then be put into tests, such as, SP 800-22, Dieharder, or PractRand.
There will always be a risk if you want to be your own bank, i.e. An authority not being able to revert any transactions, also means they can not censor/debank you, and this is a trade worth for people into the crypto (not investors/cryptobros, crypto is a currency, not an investment), for many reasons, simplest being, living under an religious/authoritarian government.
stormdelta@reddit
I'm well aware of how public-key cryptography works, and I would've thought it was obvious I'm not talking about that part.
I'm talking about the software being used to actually talk to the chain being compromised - the exact kind of attack that this whole thread is in response to in the first place.
The kind of failure I'm talking about has literally happened multiple times with hardware wallets. Mistakes and error have happened.
You seem to keep getting hung up on the cryptographic protocols and missing the forest for the trees when it comes to the full end-to-end picture of how security works in the real world.
Most cryptocurrencies are very poor at actually providing any kind of privacy - monero is basically the only one that even attempts to. I will grant this is one of the very, very few legitimate use cases for the tech, even if it's only possible by being subsidized by illegitimate uses.
Luize0@reddit
And when a bank suddenly doesn't want to do a payment because of political reasons or whatever. That is also viable? Lack of brain on this subreddit is intense.
grauenwolf@reddit
Oh that's already happening with VISA and Master Card.
It sucks and I personally think it should be illegal to block payments to legally operated businesses. Unfortunately it is often the US government pushing for these restrictions, so it's probably going to take a change in the law to make it stop.
The work-around is to use cash or a wire transfer service like Western Union.
Luize0@reddit
Unfortunately people are too ignorant to see this. And the recent thing with visa/master card is not the only example. Donations have been refused before to Assange, or the guys protesting in canada. It's all fun and games until the government says no.
grauenwolf@reddit
Agreed. People don't realize how easy it is to destroy a business just by influencing a couple of payment processors.
But it's not just the government. The current round of problems are being caused by NGO pressure groups.
grauenwolf@reddit
Oh that's already happening with crypto. Except it's not for political reasons, but rather the exchange simply doesn't want to remit the funds. Maybe they are low on cash. Maybe they just feel like stealing your money.
And since crypto exchanges are largely unregulated, there isn't much you can do about it.
grauenwolf@reddit
Oh that's already happening. People with money in crypto exchanges are losing access to their funds because they can't prove they originally bought the crypto with legitimate funds. This was prompted by a political decision (i.e. the government) in the countries where said people reside.
roscoelee@reddit
Sure. Switching to something that is vulnerable to compromised JavaScript packages is definitely preferred to a bank or whatever. /s
Zushii@reddit
Well it’s not a bank. It’s what experts have been trying to tell the world. A bank can stop a transfer, call you to make a third factor authorization, or even revert a bank transfer or worse case, use its insurance to reimburse you if the fault was their compromised application. Crypto has nothing of the sorts.
allwordsaremadeup@reddit
Banks can't do that. I've been very up close and personal with a few severe cases of invoice fraud, and banks can't help. The police can't help. Money is gone, and that's it.
danielv123@reddit
Oh, banks can help. We recently had our cfo get a phone call about a suspicious transaction that was stopped by the bank due to possibly being a scam.
They confirmed it was not a scam without consulting with anyone, and now the money is gone :)
allwordsaremadeup@reddit
This is not the CFO's fault. Social engineering hackers are gonna social engineer, it should never depend on the CFO saying "sure". The bank knows where the money went; a police report was filed saying it was theft, so the bank should get the money back. Banks should be liable for allowing criminal networks with mule accounts and withdrawal of criminal money.
danielv123@reddit
Oh, no, it was definitely the CFOs fault.
Was sent from some random free account + having the misspelled name of CEO in the "from header", marked as external email by outlook
10 minutes after phishing awareness and payment attestation meeting
Biggest bill of the entire year by quite a large margin, to a foreign lawyer of all things (we are not multinational)
Mail had all the hallmarks of being a scam - no specific names, mixed different fonts, misspellings
Bank stopped the transaction, called and confirmed that it was legit. CFO didn't even tell anyone after they had confirmed it was legit.
This was like 5th grader social engineering.
allwordsaremadeup@reddit
I'm laughing. But still, if a crime was committed, it can never be the victim's fault, no matter how stupidly they acted.
imabotdontworry@reddit
Banks in the west can all do that kind of things IF your claim is valid.
allwordsaremadeup@reddit
Not in my experience. Police can't talk to banks, banks can't talk to banks, as a non-customer, you can't talk to the bank you sent it to, there are all kinds of artificial deadlines, it's a mess. Just beyond my anecdotal evidence, there are many reports, etc, like [this one] (https://www.ic3.gov/AnnualReport/Reports/2024_IC3Report.pdf) showing billions are lost. Considering these are recorded transactions between accounts in Western banks, where people open accounts in their own names, it should be trivial to just get the money back, but no.
fire_in_the_theater@reddit
crypto could be made with this sorts. ofc that would still requiring trusting an entity with that power, and cryptonerds hate that kinda trust
stormdelta@reddit
Not requiring that type of trust is quite literally the very premise of cryptocurrency, so introducing it defeats the point.
Cryptocurrency proponents want to eat their cake and have it too, it doesn't work.
fire_in_the_theater@reddit
no it's just one premise, one that cryptobros promote to no end in complete denial that their wealth entirely depends on the massive system of govts regulating real property ownership.
crypto has other premises as well: a cheap distributed and transparent consensus on a chain of transactions. dispute and resolution practices could easily be built into the chain's protocols assuming agreement can be made on who should handle the resolution. at some point trust has to be found, we can't really built a society on a total lack of trust in others.
there are also certain problems you wouldn't want reversal with: like voting, which can be even done privately on a public chains using zero-knowledge proofs
stormdelta@reddit
"Cheap" was never part of the premise. Lower efficiency is a known and expected tradeoff for this type of decentralization.
The only ways it could even theoretically have been cheaper is by bypassing regulations and oversight, which is part of the problem.
Again, you're not wrong about trust but that's exactly why cryptocurrency doesn't work. What you're describing literally invalidates the premise of the tech, you're talking about reinventing how traditional finance already worked just with extra steps and less oversight.
A voting system nobody but a handful of experts can understand can't be trusted by the public, and that's only the tip of the iceberg of problems with that idea.
fire_in_the_theater@reddit
cheap definitely was part of the premise.
regulations, oversight, and after-the-fact corrections are extremely expensive and we want do as little of that as possible.
block chains can take a lot of the weight off such oversight by relying on computable math for much of the security ...
additional oversight for edge cases (like disputed txns) can be baked into the protocol, like i said.
it only invalidates the nonsense cryptobros pushed, which idgaf about
and a voting system that only a handful of people can audit, can?!
the trust isn't based on rationality in the first place, it's based on pure societal indoctrination, which obviously can be used to indoctrinate people into trusting a zero-knowledge proof.
stormdelta@reddit
Who's "we" here? Those exist for very good reasons - reasons so good, you're literally talking about adding them back in even with cryptocurrencies.
This is the kind of misunderstanding of security I'd expect from laypeople, not r\/programming.
We already use cryptography heavily in modern finance, and while there's plenty of improvements to be made, this is not generally where the big failures happen. The failures are down to fraud, misuse, human error, etc.
Public blockchains (aka cryptocurrency for all practical purposes) even in a hyper-idealized scenario would at best only improve the things we already do well with software and cryptography today. And would make the things we already have issues with worse, as things like fraud become far easier to do and far harder to fix.
I highly recommend you read Bruce Scheneier's articles criticizing cryptocurrency. He literally wrote the book on cryptography and security in practice.
You can't do those things without central authority and oversight. Which again not only invalidates the core engineering tradeoffs of the tech, it's also the very kinds of regulation and oversight you claimed to be against having earlier in your post!
Please stop watching crackpots on youtube and look into the history of why and how our financial regulations came to be. They exist for good reason due to many hard learned lessons over the centuries.
I'm not talking about ideological premise, I'm talking about the actual engineering and technology tradeoffs. No offense, but do you even have a background in software? I would expect people in this sub to know better, even crypto-proponents.
Systems with a paper trail visible to the voter are still widely used and what many of us advocate for. They can be audited by laypeople at scale, understood by laypeople, and are harder to compromise at scale without being noticed than people think, in part due to the first two.
fire_in_the_theater@reddit
yes, they do. but if we can avoid having to do so using computable math, that is preferred. it's very expensive to go to court and bring up documents and etc, etc ... if we can build systems that avoid having to do so as much as possible, that's a good thing.
i still think a distributed transaction ledger that we agree on saves us a lot of various kinds of effort, especially when it comes to international situations.
i'm not entirely against central oversight, but we still want to design systems which avoid the use of after-the-fact corrections as much as possible. we shouldn't desire the use of oversight, and we should design our systems to need them as little as possible, and i really do think distributed ledgers can help with this.
another benefit of distributed ledgers is it becomes trivial to build not only a distributed ledger but a transparent one, especially if you have a trusted authority (govt) managing the identities operating on the ledger.
heck, the govt already manages to bunch of identities. instead it should be managing just one identity ... the one operating on govts ledger, and that ledger should support all the operations it needs to manage the govt.
i am tho
gaslighting isn't a good sign of well reasoned arguments.
i still can't actually audit the system, all i know at that point is it's showing me my vote back to me.
personally i'd rather an open source distributed ledger based on zk-proofs where anyone could audit the actual code used to submit and validate transactions.
cryptobros give blockchains a bad rap, but the only part is really agree with them is that blockchains are the future for transactions.
stormdelta@reddit
You keep dodging the point.
Literally, the entire point of a public blockchain is to have a specific type of decentralized ledger that does not rely on central authorities or third-party gatekeepers. It makes enormous technical tradeoffs to have this property.
If central authority and gatekeepers are acceptable to have, if some trusted party has the ability to override the state, then those extreme technical tradeoffs are unnecessary and pointless.
I seriously can't stress this enough, and it's becoming clear you do not understand what public blockchains even are.
We already do use software to improve things for the most part, and for the areas we could do better, public blockchains either don't help, only provide an illusion of helping, or actively make things worse.
For example, how do you even imagine this would help with legal processes or disputes? If we want to require cryptographic signatures on documents, we could already do that without a public blockchain and there would be no value added by using one, in part because identity validation and management would necessarily already involve a central authority.
I don't think you know what gaslighting even means. And I said what I did because you seem to have deep misunderstandings about the tech that I normally associate with laypeople, not programmers.
Many places including the US have a whole process around volunteering to help oversee and run the election process.
Only a small number of cryptography experts would even be qualified to audit that code, and even if those people were able to be trusted completely by everyone somehow (I certainly wouldn't), that still gives no way for a layperson to have any confidence in it, it's a black box in an era where people are already worried about the integrity of the electoral process.
Almost nobody is using them for transactions or as currency outside of illegal transactions, even after trillions of dollars and countless man-hours were wasted trying to make it work.
jl2352@reddit
The ’value’.
We used to operate that way back in the Victorian era. Where most deals were basically a handshake, and there was zero recourse for when you got swindled. We built the protections in modern banking systems to get away from that.
barrows_arctic@reddit
I mean, that's cryptocurrency in a nutshell: hyper-libertarians re-learning, one painful step at a time, why we invented banking regulations in the first place.
fire_in_the_theater@reddit
i'm referring to market value, not existential value.
vengeful_bunny@reddit
Right but everything is a double-edged sword. They can do all that too when they or some arm of the government wants to do those things against you. In contrast, crypto (well many of the blockchains, not all) that can't happen to you, but it also means that if you're attacked, your SOL. Ugh, everything has to be hedged. Your SOL, unless it's a huge hack and the entire blockchain forks to correct the ledger like has happened on a few rare occasions in the past.
barrows_arctic@reddit
I mean...say what you will about the state of world governments in the past (and present...), but in most of the world it's fairly obvious that you are far far more likely to be harmed by some random asshole looking to make a quick buck than you are to have your assets seized or used against you by your government. There are certainly exceptions, but they are rare and generally isolated to people who are either political or criminal.
CHLHLPRZTO@reddit
"political" doing a LOT of heavy lifting in this take
barrows_arctic@reddit
Not really. Say what you will but in the modern western world, but to try and assert that a common individual being actively targeted by their government is more likely than that same individual being scammed or robbed by some random criminal is to back yourself firmly into the Moron Corner. The only exceptions I could think off of the top of my head were political dissidents (in the less-safe parts of our world) or if that individual themselves were in fact trying to run afoul of the law.
CHLHLPRZTO@reddit
I'll grant that the total number of scams is far higher than the total number of those targeted by the governments.
But to say that "Western governments are totally benign, they only target criminals and political people" is pretty disingenuous. As shown recently in the UK, "political" can mean you're a comedian who made a social media post. Assets seized, straight to jail.
barrows_arctic@reddit
Celebrities certainly could be another category of exception, but they too are a rarity, almost by definition. And in their case it partially is because they often are quasi-political anyway.
The point isn’t to enumerate all the rare exceptions here. That isn’t worth doing unless you think you are one of them. The point is that for the overwhelming majority of people (and I wager an even higher percentage of people on this thread…) it is far, far, far more sensible and prudent to prioritize defending against the category of thing that actually threatens you (scammers and thieves) not the thing you might be scared of (draconian government conspiracies).
And that means to a certain extent trusting your government, trusting legal institutions, and taking advantage of their collective banking regulations, operating norms, and insurance. Virtually of which is present with crypto.
Yes I agree that government is shit. No I am not worried about them personally seizing my assets because of some new world order. (Annual taxes notwithstanding…)
But hey, if you are paranoid enough to think the government is after you and your loved ones, then have at it. Drain your Chase account and roll the dice with a full complement of Bitcoin.
leumasme@reddit
eh, this is not just seizing but also declining to process transactions. consider the currently relevant topic of payment processors forcing game sites (steam, itch) to take down some NSFW content under threat that they will not be able to accept credit card payments anymore otherwise
barrows_arctic@reddit
Even with “multiple fronts”, it still doesn’t change the fact that the two sources of threat are not even REMOTELY in the same ballpark in terms of likelihood.
Even this thread is about yet another “random bad actor out there”.
mglvl@reddit
I’m not sure even a cold wallet would have avoided this, as you need to make sure you are signing the transaction to the correct address, which would have been obfuscated by this
stormdelta@reddit
Most don't (they're just grifters/fraudsters), and the few who still genuinely do don't understand anything about how security actually works in the real world. There's a reason actual experts like Bruce Schneier have long been critical of it.
The whole premise requires that there is no central or third-party gatekeeper to the network. Meaning any kind of authentication must be self-contained sole proof of identity, and necessarily conflates possession with ownership, as any outside authorization requires some kind of external trust or gatekeeper. Nor can any failure be revoked or rolled back, because again the whole point is no third-party trust.
It's a bit like building an indestructible impenetrable door, and then acting shocked when the thief just goes in through the window and unlocks the door from the other side.
grauenwolf@reddit
It's a bit like building thousands of indestructible impenetrable doors, and then acting shocked when the thief just presses a button and every vault mails its contents directly to the criminal.
-- Smart contract version
Ythio@reddit
No one but morons think crypto is an alternative to currency. People just want a double digit percentage return on investment and for that to happen they need to convince other people to invest so cryptobros are all jerking off each other to spew more cash so they can cash out.
Somepotato@reddit
Reminder that passkeys are phish-immune, and any service that still doesn't support them is insane.
slvrsmth@reddit
Legit question - as I understand, passkeys are in essence "your computer signs a challenge with your private key". So how do you enroll a new device to the same account? Keep the private keys in your password manager?
Somepotato@reddit
You can do that, or, most services allow you to enroll more than one passkey. Or you can get a hardware key (there's NFC, Bluetooth, etc models, and you can even use your phone as one)
paul_h@reddit
I dream of being able to periodically sync two or more hardware key-holding devices AFTER enrolling one with a site.
ReanimationXP@reddit
this is hurting my brain - what? example?
paul_h@reddit
For something like the Token2 Bio3, enhancements would be:
Token2 could make that today with very similar hardward and call it the Bio4.
Somepotato@reddit
That would be inherently insecure, they're by design unconable
paul_h@reddit
I dream of being able to periodically sync two or more inherently secure hardware key-holding devices AFTER enrolling one with a site.
slvrsmth@reddit
So the solution is to always have n+1 devices logged in everywhere? With the +1 supposedly stored in a safe? Or get an additional purpose-built device?
I understand the idea passkeys are trying to solve, but the whole device-specific private key business is keeping me well away from using them. Where I currently use a password manager with network-synced database, I would need at least a password manager with browser integration. And hold on, would I need the password manager to integrate with every app on my phone? Or every login is now o-auth webview?
Either I don't understand the whole thing (likely), or the people behind passkeys have never lost or destroyed a device.
Somepotato@reddit
For apps and sites that support passkeys, your os will via Bluetooth use your phone to authenticate you.
I use a yubikey in a safe, plus my phone for general use. Hasn't been a problem yet.
Advocatemack@reddit (OP)
The maintainer doesn't yet have control of his NPM account
BugBaba_dev@reddit
The maintainer still trying to get access back to his account in order to assess what actually happened.
ClonedY@reddit
So, there is a single maintainer on which Millions of websites are dependent for their security?
BugBaba_dev@reddit
Not exactly. Most popular packages have multiple maintainers or backups, but sometimes smaller packages are managed by just one person.
The issue is that these smaller packages can be dependencies inside bigger ones - like a tiny screw in a huge machine. So if that one screw breaks, it can affect millions of websites.
That’s why the community and companies like npm are working on ways to split responsibilities and improve security checks, so no single maintainer holds all the risk.
coderemover@reddit
There are better solutions than splitting responsibility. A pretty obvious one is cryptographic signatures.
tsimionescu@reddit
There's nothing different between an NPM account and a cryptographic key. If someone can successfully phish the maintainer, they can get their private key and cryptographically sign new versions in their name just as easily as they did here.
coderemover@reddit
They can do it only for the new versions. Someone else has to manually pull them, for the attack to be successful.
tsimionescu@reddit
Yes, and this is exactly what this attacker did. Since the NPM ecosystem very often defaults to picking up the latest (patch) version of every dependency (e.g.
npm install
pulls in the latest dependencies, ignoring yourpackage-lock.json
file), this is still a very dangerous attack.coderemover@reddit
So that’s the problem of stupid npm defaults.
old_man_snowflake@reddit
soo.... yes. there's one single dude who can take down/compromise nearly every webpage.
There's a reason to not use version ranges.
Substantial-Pack-105@reddit
I got to be that dude for a while. I had an open source library, getting like 10k downloads a week, until it one day it became a dependency in a major, well-known application monitoring service. Suddenly, my code was being deployed into hundreds of thousands of servers overnight.
njmh@reddit
Yup, always version lock and consider using tools like dependabot.
Also, leftpad taught me to always ask myself "Do I really need a package for this?"
fullup72@reddit
sure, and then dependabot auto-updates you into a hijacked version, just that you don't know it yet but it's mandatory per company policy because dependabot raised a flag against your "outdated" version.
And sure, you will say "just review the PR carefully!", but when dependabot keeps raising 10 to 15 PRs per day because every dependency is on an update flurry you end up just rubber stamping whatever dependabot suggests (and if those deps are not pinned themselves, you still pull updated versions of their deps).
BugBaba_dev@reddit
Kinda, yeah. It’s like one guy holding a single Jenga block that’s propping up half the internet.
If his account gets hacked or he pushes bad code, millions of sites can break overnight.
Pinning versions isn’t a magic fix either — it’s like duct-taping the Jenga tower. Looks stable, still collapses if the wrong block goes missing.
We should be more cautious when running npm install. It is a good idea to review package owners and changelogs first, and use security tools like Snyk or Socket.dev to help catch potential threats early.
satireplusplus@reddit
Well someone thought it's also a good idea to have every little function be a separate package maintained by god knows who.
pyeri@reddit
I had written an article on this way back in 2018 when webpack was sitting on some tiny dependencies like nanomatch, is-odd, etc. Apparently, such caution to wind over the years have fallen on deaf ears and these ideas still continue.
BoringElection5652@reddit
I refused to use webpack for the simple reason that it had is-odd in its dependency tree back then.
Extra_Status13@reddit
Apparently it's a JavaScript specific problem as rust is 100% safe and perfect with the giga trillion dependencies every project has! /s
karmahorse1@reddit
Why I write nearly all my own utility methods. Why import a library written by god knows who for functionality that takes less than a minute to write yourself?
rooktakesqueen@reddit
On the other hand, when you roll your own utilities, you may inadvertently make yourself vulnerable to exploits and not get the advantage of security fixes issued by well-maintained open source dependencies.
On the gripping hand, exploits are usually researched and pursued based on return on investment, and that means open source libraries are more likely to be targeted for having a larger cross section than your singular site where everything is bespoke.
So it's all complicated.
ShinyHappyREM@reddit
...
Forward_Ability9865@reddit
Are you really suggesting that small functions are never exploited? it only takes one character to go from a fully safe code to one that is exploitable on every front. Not argumenting against the importance for less dependancy, but your argument is just very wrong and dangerous.
falconfetus8@reddit
We're not talking about cryptography libraries here, we're talking about micro packages like
is-even
. With functions that small, the chance of an accidental vulnerability is far lower than the chance of its maintained becoming compromised.If your own utility function has a vulnerability in it, you at least have the ability to fix it yourself, rather than hoping Joe Schmo is motivated enough to fix it for free. You accept a modicum of responsibility, and in exchange gain a lot more security.
Manbeardo@reddit
Yes, and? Many of the most common exploits come from doing things the easy way instead of the less-obvious safe way. See: SQL injection.
Chii@reddit
i mean, there's a price that has to be paid for free, but quality software. Nobody wants to pay it. Volunteers who do it cannot be responsible for all downstream problems that their lapses in security might cause.
PurpleYoshiEgg@reddit
Do you, though? If you write Javascript using the standard library (which is feature complete enough, in my experience, to never even need so many of these weird utility libraries), you surely don't have the attack area that you would have to worry about if you otherwise used a library from some random person you don't know to code on top of. Especially for something that takes very little time to write.
Like, yeah, don't roll your own crypto, but why do you need to use a library to test if something is odd or even? If it takes you more than a few hours to write something, then yeah, search for a library, but I don't understand why there are so many libraries in the Javascript ecosystem when the standard library has been fine enough for everything I've done.
Can you give an example of something that would be a simple utility function in Javascript that would be a nontrivial exploit in which a well-maintained library avoids? Because I don't think those actually exist.
cdb_11@reddit
Is this sarcasm? I can't tell. I just made a joke just like this, but you actually sound kinda serious.
rooktakesqueen@reddit
Not at all? The lesson you should take from Heartbleed is not to roll your own crypto. You should still judiciously use dependencies.
On the other hand, rolling your own left-pad is probably not going to introduce a vuln, and it will protect you from supply chain attacks.
(I say "probably" because it depends, if you're writing in C and aren't careful with bounds checking, your buggy left-pad could absolutely turn into an arbitrary code injection vulnerability)
cdb_11@reddit
OpenSSL is not a utility function, and the context is Javascript.
mfandrade@reddit
https://www.npmjs.com/package/is-odd
mr_sunshine_0@reddit
A decade ago you’d have been drowned out with downvotes for suggesting this.
satireplusplus@reddit
Well know you can get drowned in downvotes by suggesting that your favorite LLM writes those utility functions for you.
cristoper@reddit
Your comment prompted me look it up... it's been almost a decade now since the leftpad incident.
Tsukee@reddit
Not all npm libraries are like that.
Microlibs are a legacy artifact (i agree a wrong one) of reducing clients bundle size, nowadays almost all bundles can do decent tree shaking so if you use 1 function of a library it doesn't bundle the whole library, just the dependency chain.
Also a lot of seemingly simple functions in js can be written in ugly but highly optimised ways which shouldn't really be part of your own codebase. Ofc you are welcome to write and maintain your own library but the work adds up. We live in a world where pumping out apps faster and faster is the norm and a requirement, yes security often suffers because of it but especially around npm many have learned how to strengthen your supply chain and prevent such things to get in easily. The real issue i see in this attack is how web3 still has little direct browser integration and how incredibly unsafe it is, given how easily an injected js code into a library can drain your wallet.
coderemover@reddit
Because most of the time you don’t have the time to implement good enough util. That doesn’t apply to trivial stuff like leftpad but good luck implementing a state of the art hashmap, parsing library, embedded database system or ORM. So dependencies are inevitable, and you have to figure out a safe way to use them anyway. Once you have a good system of including dependencies, it can be also used for simple stuff, because why not? You can and should vet any code you depend on anyway, and it’s trivial to check leftpad vs something bigger like an embedded database.
EnGammalTraktor@reddit
WDYM Dude!? Every hip project needs a "is-arrayish" import!
coppercactus4@reddit
This is why JavaScript is a hot mess. I do both frontend and backend in c# and it's just a night and day difference using a language that has batteries included. There are hundreds of first party libraries written by Microsoft that come with the language. Of course there is a package manager (NuGet) but projects would have tens of references not thousands. Transitive dependencies are usually that big (except for the Microsoft ones).
BasieP2@reddit
https://berthub.eu/articles/posts/on-long-term-software-development/
OnionsAbound@reddit
Coming from "traditional" software development, some web developer's tacit use of libraries for every little thing is just appalling. I swear maybe a third of stack exchange answers are "download this library! It will do it what you want!"
Like, I'm sure it (maybe) will, but I don't really feel like introducing even more dependencies in my app . . .
RirinDesuyo@reddit
This is why it's so important to have a good BCL to lean on imo. You'd not have this issue of millions of micro-packages if the BCL included is comprehensive from the get-go or at least have a dedicated 1st party package the acts as the BCL with no 3rd party dependencies. This is why in dotnet for example, you rarely need to pull a package for simple utilities as the BCL provides almost everything you need. Most of the time, if you check the package dependency tree for nuget libraries, it usually stops 2-3 depths back to the BCL (e.g.
System.*
) or to a 1st party package (Microsoft.*
) namespace.The only reason you'd pull for a package there is if you need to do complex tasks (e.g. web server, image manipulation, document parsing etc...). But things like manipulating arrays, parsing strings, and in this case richer exceptions objects are all included on the BCL.
AegisToast@reddit
jquery pokes its head out from around the corner
“Hey guys, are you talking about me?”
ClownPFart@reddit
that's web development
lollaser@reddit
welcome to npm land
AegisToast@reddit
There are several single maintainers on which millions of websites are dependent.
There was an incident a few years ago where one dev pulled his packages entirely off npm, and because a huge majority of major packages were dependent on some of them, he took down like half the internet for a few hours.
Kind of crazy, but modern tech is basically just devs building on top of other devs’ work, who built theirs on someone else’s, and on and on. There are lots of potential single points of failure.
fullup72@reddit
the infamous
left-pad
incident, caused by taking the "don't reinvent the wheel" mantra to an extreme and going as far as using packages likeis-even
becausex % 2 === 0
is too much work for some people, and what if the definition of "even" changes and you need to modify your entire codebase!?idiotsecant@reddit
https://xkcd.com/2347/
JayWelsh@reddit
What is the mitigation for this? Is it enough to do an `npm audit fix`?
BugBaba_dev@reddit
As far as I know, npm is working on two things:
Fixing the vulnerabilities (what the community is working on right now).
Creating a patch to neutralize the malware, so even if someone runs it, it becomes harmless - including any systems that may have already been affected.
Friendly_Marzipan586@reddit
>Creating a patch to neutralize the malware, so even if someone already installed an infected version, it becomes harmless.
They best they can do is drop malicious version, mark version as malicious and release new safe with smallest version bump to make sure it will get installed in the closest next npm install on user machine.
I have to disagree with second point bc this code isn't remotely controlled nor sending data to remote sever. If it did that, they would sinkhole domain or try to take machine of attackers down. But this one just reroutes money to other eth wallets, not many options to save ppl who already have this on their machines except notify them in any possible way
fullup72@reddit
Actually the latter one can be fixed by browser vendors. Native browser interfaces like
fetch
,XMLHttpRequest
and evenpostMessage
should be sandboxed for browser extensions so they always get a clean and unadultered version of these. Pages monkeypatching these interfaces should never affect browser extensions, because that's how they got poisoned this time around.tnemec@reddit
... okay, maybe a dumb question, as I know basically nothing about browser architecture: what possible legitimate use is there for making interfaces used by browser extensions overrideable from arbitrary (and by definition, untrusted) site Javascript?
Like, that sounds absolutely psychotic, to the point that it seems more likely that I'm not understanding the exploit or missing something, rather than that this is just how browsers worked and it just happened to not come up as an exploit until now.
laplongejr@reddit
I know that my country's eid work with a browser extension, so there must be SOME way for trusted websites and trusted extensions to commnicate. I guess some website had some special usecase and nobody stopped to think about security?
balefrost@reddit
To be fair, I think this is already true for Chrome extensions. An injected content script can interact with the page via the DOM, but the JS environment is otherwise isolated. Changes made in the context of the page's JS environment are not visible to the content script's JS environment (and vice versa).
Dunno about non-Chromium browsers.
Friendly_Marzipan586@reddit
I just recently worked with that, there are ways to inject your script in, what they call, `MAIN` world and you can freely monkey patch at least XMLHttpRequest for sure but ONLY if you allow execution of user scripts which is off by default. Previously it was a permission available only in chromium developer mode, now its a toggle in extension settings. The extension context itself was and is isolated.
balefrost@reddit
Ah I see: https://developer.chrome.com/docs/extensions/reference/manifest/content-scripts#world-timings
Looks like that option was introduced in Chrome 95 from Oct 2021.
JayWelsh@reddit
Do we know if there is any sort of persistence logic built into the malware? Or does it effectively get removed when the node module is updated?
Friendly_Marzipan586@reddit
Code snipped that provided in aikido's blog post doesnt seem to have any persistance, its just monkey patch several functions. So getting rid of malicious deps and reload pages should be enough.
I wonder is it exactly same snippet in each of infected libs
Kind-Satisfaction940@reddit
How long was this vulnerability out in the wild for undetected?
Decent_Ad_9615@reddit
It’s in the first sentence, you goober.
JayWelsh@reddit
Thank you
BugBaba_dev@reddit
nahkampf@reddit
So, did this maintainer not have 2fa?
Advocatemack@reddit (OP)
He did but it appears the phishing page had aan in the middle mechanism that stole the MFA codes and session tokens
nahkampf@reddit
Oof.
hajime_kijima@reddit
What we can do is that we should each fork the NPM package and write our own versions, this way, we will not have a single point of failure. All existing packages will have a duplicate package made by different users and we know we’ll never have a large supply chain attack like this one. Thoughts on this?
BugBaba_dev@reddit
Forking every package might sound like a solution, but it doesn’t scale - most forks would quickly go stale, and there is no guarantee anyone would actually use them.
A better approach is verified publishing (Sigstore), mandatory 2FA for maintainers, and using tools like Snyk or Socket.dev to catch malicious updates early.
This is the same direction npm and GitHub are already taking after recent supply chain attacks.
oorza@reddit
This was a social engineering attack. There's a reason the nukes take two people to launch. Every system where one person can make executive actions in isolation is vulnerable to this type of attack.
rdtsc@reddit
Like that
is-arrayish
package which had its last version published 7 years ago?The author had 2FA enabled…
BugBaba_dev@reddit
A stable package like "is-arrayish" staying untouched for years is fine - it just means the code has not needed changes.
But if thousands of people forked it, fixes and security patches would get scattered across many copies, breaking CVE tracking and making it harder to keep users safe. That fragmentation creates more risk, not less.
And you are right - 2FA alone is not bulletproof. In this attack, the maintainer had 2FA enabled, but attackers stole publish tokens or CI credentials, bypassing it entirely.
That’s why npm and GitHub have started rolling out trusted publishing (short-lived OIDC tokens instead of static tokens) and signed releases (package provenance) alongside 2FA - a layered defence to stop future supply chain attacks.
ClownPFart@reddit
The maintainer is a dumbass who fell for an obvious phishing email (hurr .help tld, looks legit)
Then again he's a npm package maintainer so obviously he's a dumbass
web devs lol
BugBaba_dev@reddit
The maintainer’s account has been restored, and all packages published by him should now be back to normal.
Advocatemack@reddit (OP)
Response from maintainer on HackerNews (personal note: Its great to have a maintainer that has been so responsive and owned up quickly, we all make mistakes)
https://news.ycombinator.com/item?id=45169657
Hi, yep I got pwned. Sorry everyone, very embarrassing.
More info:
- https://github.com/chalk/chalk/issues/656
- https://github.com/debug-js/debug/issues/1005#issuecomment-3...
Affected packages (at least the ones I know of):
- ansi-styles@6.2.2
- debug@4.4.2 (appears to have been yanked as of 8 Sep 18:09 CEST)
- chalk@5.6.1
- supports-color@10.2.1
- strip-ansi@7.1.1
- ansi-regex@6.2.1
- wrap-ansi@9.0.1
- color-convert@3.1.1
- color-name@2.0.1
- is-arrayish@0.3.3
- slice-ansi@7.1.1
- color@5.0.1
- color-string@2.1.1
- simple-swizzle@0.2.3
- supports-hyperlinks@4.1.1
- has-ansi@6.0.1
- chalk-template@1.1.1
- backslash@0.2.1
It looks and feels a bit like a targeted attack.
Will try to keep this comment updated as long as I can before the edit expires.
---
Chalk has been published over. The others remain compromised (8 Sep 17:50 CEST).
NPM has yet to get back to me. My NPM account is entirely unreachable; forgot password system does not work. I have no recourse right now but to wait.
Email came from support at npmjs dot help.
Looked legitimate at first glance. Not making excuses, just had a long week and a panicky morning and was just trying to knock something off my list of to-dos. Made the mistake of clicking the link instead of going directly to the site like I normally would (since I was mobile).
Just NPM is affected. Updates to be posted to the `/debug-js` link above.
Again, I'm so sorry.
bzbub2@reddit
So....just guessing at whole account stealing procedure.... it seems like he must have clicked fake link, tried to login on fake link, then he entered the 2fa information to wrong site as well, then hacker took that info, logged into real npm site as him, got control of the account, changed email and password and 2fa settings on his account, then blasted out new versions. Given how easy it is to fall prey to this...like these fake websites that mimic original ones... are there any technical solutions to avoid this happening?
Middle_Citron_1201@reddit
Passkeys are (in most conditions) unphishable. That’s one of the reason security folks are so passionate about them. To be able to trick a browser or other software into signing a pass key challenge that isn’t authentic you’d have to already compromise the developer’s environment to a level that you might not even need to phish them.
danielv123@reddit
Do passkeys enforce the domain to be correct?
AuroraFireflash@reddit
Depends on the protocol. WebAuthN / FIDO2 only give the passkey back to the domain that was associated with generating it in the first place.
Middle_Citron_1201@reddit
They do. So in order to phish a passkey response they need to already make your browser believe it’s talking to the remote host when it’s not.
I’m sure there are some scenarios where a targeted nationstate attacker would want to do something like that, but this kind of thing would be a lot more difficult
camh-@reddit
Passkeys or webauthn (fido2). These forms of 2FA are bound to the website so a fake site cannot intercept the credentials. A TOTP is vulnerable to being intercepted.
Yadobler@reddit
I remember the maintainer of hibp got his personal blog mailing list leaked (pretty ironic) by the same MO: very tired / jetlagged and on mobile, missed the very hidden subtle signs that one wouldn't notice unless constant paranoia
Advocatemack@reddit (OP)
The original phishing email came from support@npmjs[.]help
it is very likely there will be more comrpomises from phishing campaigns from this email like what we saw last month with compromises coming from phishing emails from the domain support@npnjs[.]com
-Y0-@reddit
I wonder can you use similar looking, but different letters in your TLD? E.g. cyrilic со followed by latin m.
tsimionescu@reddit
Browsers have a large set of heuristics that try to recognize such cases and replace the Unicode domain name with a punycode version to avoid confusing users, at least for some common domain names such as google.com.
laplongejr@reddit
I recall doing an example of the attack for one of our final group exams.
At the time browsers had no fix yet, so the only mainstream browser safe against it was... Internet Explorer.
"Wait, how can IE be the only one to have fixed that?"
"They didn't fix it. They are so late the internationalized domains aren't supported yet, so the domain has 0 chance of fooling the user"
Teacher laughed as the ancient tech was somehow winning on that specific case.
oojacoboo@reddit
All these TLDs are just a security issue. I mean - who needs a .help TLD really? On one hand, I support all these TLDs, but on the other, it's just a dirty money grab that hasn't improved the web at all. Our company is now forced to buy dozens of brand.TLD domains, due to this, and ICANN knows it.
Luxalpa@reddit
The real security issue is that we're still manually entering passwords.
Ruben_NL@reddit
This. A password manager is a security tool. If it doesn't auto-suggest (or even auto-fill) the correct item, you probably aren't on the correct website.
tsimionescu@reddit
Or, as happens somewhat often, the site has changed their login page URL to go to some subdomain, or maybe to some sister domain after an acquisition, or they've just created their new login system for multiple different products that used to have separate logins, etc.
alex-weej@reddit
bsky.app, bsky.social, bsky.network, bsky.biz, bsky.tk, ...
doiveo@reddit
Curious, I asked GTP what the most popular .help domains were ... all came back as redirects to porn. Need a better source.
The most obvious self.help is for sale.
Advocatemack@reddit (OP)
More info on phishing email here -> https://github.com/orgs/community/discussions/172738
kranker@reddit
It's crazy to me how common it is that companies use multiple tlds for different parts of their system. It's somehow normalised behaviour that leads people to accept the possibility that this could be a valid npm address. This is a dev too. Your parents have no chance.
Somepotato@reddit
the extra fun problem is how insanely difficult it can be to take down a parked domain or domain misused like this
Existing-Mention8137@reddit
RapidFort released a utility to help teams quickly identify exposure from the Qix NPM compromise: https://www.rapidfort.com/press/how-rapidfort-is-helping-the-community-and-customers-address-the-qix-npm-supply-chain-attack
SpaceNerduino@reddit
Here I share my own experience with this. I lost this whole afternoon battling this :
https://lollms.com/index.php/2025/09/08/surviving-the-largest-npm-supply-chain-attack-in-history-a-developers-first-hand-account/
ryanlrussell@reddit
Did you have/save any copies of the compromised NPM packages?
Whispeeeeeer@reddit
One of the packages is still corrupted: https://www.npmjs.com/package/simple-swizzle/v/0.2.3?activeTab=code This article already breaks down how the code works, but it's kinda cool to check it out in the actual source code.
Whispeeeeeer@reddit
OMG this single function library uses one of his other packages as a dependency
I don't understand the culture around NPM packages.
KerrickLong@reddit
This part of the culture basically comes down to "the standard library should really include this. I'll publish it so others don't also have to write it."
shevy-java@reddit
In a way this also described left-pad. You don't see this in ruby and python because these languages are better designed than JavaScript. Nobody would have a use case for something like left-pad there; in ruby I just tend to either use % with the format specifier e. g. '%.3f' % '3.0'.to_f # => '3.000' or for simpler cases e. g.
Python has something similar. JavaScript evidently has had a need for left-pad, which is a tragic comedy. JavaScript is the monty python of programing languages, but less funny. This dead parrot was always a horrible parrot.
KevinCarbonara@reddit
This is the part that bothers me. So many people turned left-pad into an issue of "Developers who use Javascript are stupid and lazy" instead of "The developers who created Javascript are stupid and lazy and the users are having to fix the language for them"
wutcnbrowndo4u@reddit
It's both?
It's ridiculous that left-pad would even exist, but a dev operating in that environment is being "stupid and lazy" to add a breaking dependency for 5 lines of simple code.
KevinCarbonara@reddit
No, they're not. That's what standard libraries are for. And that's the role that NPM fulfills.
wutcnbrowndo4u@reddit
No, because stdlibs don't add a meaningful dependency on top of the language itself. That first-class citizenship is what makes them stdlibs, and they're accompanied by an attendant seriousness around how distribution is managed. Npm is nothing close to that.
Again, you're framing it in terms of what concepts map to each other, which obscures more than it illuminates. The incentive math is as simple as:
does saving five lines of simple code come at the cost of a new critical dependency that a random dev can break on a whim ->
-> you shouldn't do it then
KevinCarbonara@reddit
You're moving the goalposts. That behavior is the same among devs in any language. The deficiency lies within the language and its ecosystem, not the developers.
wutcnbrowndo4u@reddit
Not moving the goalposts at all: I'm explaining why it's inaccurate to claim that "npm is the stdlib of the JS ecosystem". You have the same dynamic when you depend on a random pip pkg, but not when you depend on the Python stdlib
And yes, Javascript is a horrifically deficient ecosystem. That is in no way relevant to the developer's job of behaving sanely within that ecosystem.
If somebody insisted on using malloc/delete and had memory issues destroying their c++ software, it would be weak tea to say "oh well it's a deficiency in c++ that it isn't memory-safe". Possibly true, completely irrelevant to the choices you should be making as a developer.
Remember, we're not talking about rolling your own crypto here. We're talking about five lines of string-handling code
KevinCarbonara@reddit
But it's the closest thing the JS ecosystem has and developers are making do, which was precisely my point.
wutcnbrowndo4u@reddit
Right, but I'm saying that "making do" would be "writing 5 lines of string-parsing code instead of adding a breaking dependency to your app".
That goes back to what I said in my prev comment: the tortured logic of drawing false equivalences in order to justify irrational behavior doesn't stand up to the straightforward fact that adding a dependency on leftpad is an obviously and extremely bad idea, not worth the stability/velocity tradeoff in any sane scenario.
I'm certainly not suggesting that npm (or pip) never be used! But it's absolutely "stupid and lazy" (to go back to the orig pt of this subthread) to make that trade-off in the left-pad case, which is why that case was so illuminating.
tsimionescu@reddit
That is certainly not true. For example, in Java, instead of myriad tiny packages, people either roll their own utils, or pick up additional utils libraries, like apache-commons or guava. You won't find a "letf-pad" or "is-arrayish" on Maven, certainly not one with hundreds of millions of downloads.
KevinCarbonara@reddit
Or they use third party technologies like Lombok or Spring to help make up for the deficiencies inherent to the language. You're proving my point.
https://projectlombok.org/
Zomgnerfenigma@reddit
There was plenty of time since left pad to fund an org that fixes all that. I guess no one cared?
KevinCarbonara@reddit
There's not a lot of investment in Javascript because it's a garbage language. But it's in heavy use because it's what everyone knows. It's a Catch-22.
SwiftOneSpeaks@reddit
This is a bit unfair. JS lives in a unique environment seeking nearly 100% backwards compatibility. The core language is slow to evolve because they can't just roll back in a later version. It is generally pretty reasonable to decide your python code requires a recent version of Python that has addressed common oversights in the original core library, because your python code only worries about the computer running the cost. But JS runs in the browser. Every browser that visits your site. It spent 10 years having to worry about IE 6.
JS (ES) is nonetheless still around, unreplaced, still improving (slowly), and something that basically every person in industrial nations uses daily. Incidentally, padStart (left pad) was added 8 years ago.
I know it's easy to dump on JS, and JS has real issues, and a lot of the benefits of the mon-JS web are too often left behind, but just mocking JS (or JS devs, though you personally didn't do that, thank you) names is not helping yourself or anyone else to learn anything.
grauenwolf@reddit
Java lives in a unique environment seeking nearly 100% backwards compatibility.
C# lives in a unique environment seeking nearly 100% backwards compatibility.
C++ lives in a unique environment seeking nearly 100% backwards compatibility.
Rust lives in a unique environment seeking nearly 100% backwards compatibility.
Python lives in a unique environment seeking nearly 100% backwards compatibility.
therve@reddit
None of those serve code that is executed by a third party runtime.
grauenwolf@reddit
C++ and Java has multiple implementations of the runtime. C# used to as well. I think Python does, but I haven't looked into it recently.
Not that it matters because this isn't an argument for not having a standard library.
Luxalpa@reddit
I think it does matter, because Rust has a very similar problem for the same reason. The Rust standard library has a very strong committment to backwards compatibility (although they at least got the edition mechanism), and in turn, it also has the same effect where only the most elementary elements and utilities are in it, but anything more complex (like you see in Go a lot) is in third party libraries.
It's possible that these effects are actually unrelated, but I wanted to put it in here, because I think it's quite possible that they are indeed related.
grauenwolf@reddit
You haven't actually demonstrated a problem. At most you've added one more decision by the Rust team that i disagree with.
Luxalpa@reddit
Yes, I haven't, because that was not the task.
The problem that this is solving is backwards compatibility. I can install a Rust library that was unmaintained for 9 years and it will just work with the newest compiler, without any modifications or bug hunting. This is true for JavaScript code as well. I was able to take my little website that I wrote in 2016 using the Angular 2 beta and just npm install it and it just works like it did back then.
Whether or not you care about this is a different story. But for example, I have a ton of old C++ code from my old days lying around here, and it depends on certain versions of Qt, MingW and qmake. Getting those to work under newer versions of MSVC alone is a big undertaking.
tsimionescu@reddit
You can also take a Java program written for Java 1.0, and do
javac my-file.java && java my-file.java
and there's a very good chance it will start and run the exact same way it did back then. Same is true for C++ and C# and others as well.You're mixing up different issues here. There is no C++ package manager that could find the right version of Qt for your specific version - but if you could, that problem would go away. And the fact that MinGW and qmake have backwards incompatible changes that are outside the scope of the C++ standard is a completely separate issue.
Luxalpa@reddit
Maybe that's true for a small toy program. But there's no chance for this to be true for any production scale enterprise program or library.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/9.0?source=recommendations
If your legacy project depends on any of the things on this list, it will break (silently or loudly) after change. And that's just a single version. There's a reason why every fucking app installs its own version of .net framework as if it was a third party library.
grauenwolf@reddit
And how would having a standard library affect this?
I have plenty of old C# code from decades that just works in the newer version. The existence of a standard library didn't magically make that harder.
Luxalpa@reddit
This has nothing to do with existence of a standard library; every major language - including javascript - has one. This is only about the scope about this standard library.
The scope of the standard library affects this because adding more stuff to the standard library can be more easily done if you are allowed to later make changes to it. It is much harder to do however, if you are not allowed to do breaking changes later.
valarauca14@reddit
> this is literally the entire point of a JVM
Luxalpa@reddit
I think that's missing the point though. The Java Bytecode has these restrictions, sure. Just like the .net bytecode. But even then, you can simply ask the user to install a newer version of the runtime when they install your application.
What makes JS unique is that it is shipped passively in the browser. As code, not even as bytecode. You can't ask the user to update their browser, because the user doesn't even know yet if they care about your app or not. There's also a lot of different browsers all with their own JS implementations. The same is true for HTML and CSS. You can't simply do a backwards incompatible new standard like you can do in any of the other mentioned languages.
iamapinkelephant@reddit
None of those examples have anywhere close to the requirements of JavaScript. None of your examples need 100% backwards compatibility. All of your examples either compile to a platform specific binary or are shipped with a platform specific runtime.
Unless your 'I am very smart' universe includes shipping a device specific version of a JavaScript runtime engine on every page load? Good luck downloading a quarter of Chrome every time you go to a website.
grauenwolf@reddit
You don't need to put the standard library for a programming language into the runtime. That's why it's called a "library". Physically, it could literally be just another NPM package that everyone agrees on with matching CDN support.
Honestly, your whining is making other Javascript devs look bad.
NoveltyAccountHater@reddit
Sure but backwards compatibility means different things. Yes, any code written for python 3.6 will work for any future version of python 3.x assuming x>=6 (if they used features introduced in python 3.6). (Web) javascript's problem is that you don't get to control the end-user's client and version of javascript they are running.
In (web client-side) javascript, you often want to write code that will run on all your users' web browsers, regardless of how old or non-standard-compliant there browser is.
While most users will use a handful of modern browsers (e.g., chrome, safari, edge, firefox) that have been recently updated, there will be a handful of people on old devices using old browsers that you may be required to support. E.g., some random person browsing from the built in webclient on their smart TV, or someone using an old random phone, or people browsing on an e-reader, etc.
grauenwolf@reddit
That's not true. Download yourself a copy of Netscape Navigator 4 if you don't believe me.
We will make a good faith effort to support older browsers using polyfills, which you can still do with a standard library.
In the simple case, the standard library is just another npm package that you reference no different than the ones we're doing now other than the fact that it's a lot more sane.
In the complex case the browser has the libraries built in and the package version would defer to the browser version if the browser version is high enough.
NoveltyAccountHater@reddit
Again, yes I'm well aware modern websites don't fully support the oldest web browsers or redirect some users to a simplified less-feature filled version to avoid having to polyfill everything.
But again, the problem that polyfills solve is that modern Javascript is often run by older clients that may not support all the latest features. This is fundamentally a different compatibility problem that doesn't exist in most other languages. You don't write Java 21 code and expect users to run code on older runtimes (because you tell the user installing the software to use the appropriate runtime or a future version). There are sometimes a couple analogs to polyfills in other languages (e.g.,
from __future__ import feature
in python where say in py3.6 you can import f-strings from python 3.8), but this is a different type of compatibility issue.grauenwolf@reddit
LOL I learned how to polyfill C# libraries by watching what they did in Javascript.
obhect88@reddit
Go would like an invite to this chat.
grauenwolf@reddit
Are you saying that Go also cares about backwards compatibility? Or are you saying that Go developers wish Go cared?
obhect88@reddit
Sorry, I was not clear. The folks at Google that author Go have a backwards compatibility promise.
Some reference material:
https://go.dev/blog/compat#go2
grauenwolf@reddit
That's good to hear. Surprising given that Google very much does not think that way about their cloud offerings, but good none the less.
nnomae@reddit
Adding a versioned standard library without breaking existing code isn't an insurmountable problem.bThere are hundreds of web standard JavaScript libraries, covering everything from websockets to graphics to audio and almost every other piece of scriptable functionality in the browser. Adding one for simple quality of life functionality wouldn't be that hard.
look@reddit
Getting everyone to agree on what should be in the official standard library is the hard, slow part. - https://tc39.es - https://wicg.io - https://spec.whatwg.org - https://www.w3.org
There have been many unofficial attempts to make a de facto standard library: Prototype, Mootools, jQuery, underscore, etc, but that hasn’t gone well either. https://xkcd.com/927/
nnomae@reddit
I'd agree there, the problem is political not technical.
Zomgnerfenigma@reddit
It's a problem because someone has to do it and create an streamlined experience. That's a lot of work.
Looking at the package names, I don't think they would be priority for an standard library, if at all.
Even if it happens, you'd only reduce the attack surface and not solve the problem.
lechatsportif@reddit
In practice seemingly no one actually prioritizes this goal. They seem to pay lip service to it happily breaking stuff until they can get around to it. If the community really cared about backward compatibility it would feel more java like.
danielv123@reddit
Where have they broken backwards compatibility?
ipaqmaster@reddit
ljust
my belovedjl2352@reddit
Is Arrayish is another example. As there are ways of making your own Array like objects.
You can also have multiple instances of the Array prototype in play. Meaning an object might be an instance of an Array, it’s just not an instance of your Array. This one is more of a weird factoid of how browsers work rather than JS, as that’s where it comes up.
csorfab@reddit
Yet Javascript was able to evolve in a way that it now accommodates most of the web on client and server alike, which is an impressive feat from a language that was hacked together in 2 weeks. Sure, some of this evolution came out of pure necessity, but it still illustrates the cleverness of the original design, even if there were some less fortunate choices made (which we can now completely ignore thanks to Typescript or other tools). Show me a competent engineer who would choose Ruby over Typescript for anything serious.
Don't get me wrong, I loved Ruby back in the day, but it provides, and even encourages so many footguns that JS could hide in shame.
wasdninja@reddit
const x = 'abc';x.padStart(33, '_')
does the same thing. It's been around since 2017.sad_bug_killer@reddit
The left-pad incident was in 2016
BubuX@reddit
by that logic, rust is doomed
SanityInAnarchy@reddit
There's that, but there's at least two other things:
One is, historically, it was easier to write a tool that bundles and minifies a bunch of tiny libraries, rather than one that removes unused code within a library. I don't think this is a good reason anymore, especially with TypeScript, but there was at least a point in time where single-function libraries mean the functions you don't use don't have to get shipped to everyone's browser anyway.
The other is, it's an easy way to get an impressive-looking Github portfolio, at least if no one actually looks at any of the hundreds of packages you've published to find out that they're each a single line of code.
psaux_grep@reddit
Also open PR’s to 100’s of open source projects to use your library instead of 3 lines of code and then when some of them gets approved you can get to brag about all the organizations using your code on account of using the project you pushed crap into.
danielv123@reddit
Swizzle is also just [].flat() so why 27 million (and growing) people download it every week is beyond me.
sysop073@reddit
I don't understand why so many people don't understand this. It's easier to import it than write it -- that's literally all there is to understand. It's only confusing for people who use languages with bad or non-existent package managers where it's hard to add a dependency, but for most newer languages/frameworks it's extremely easy so people just do it.
alienangel2@reddit
Nobody is saying they don't understand what the short-term reason for writing it was. They're saying they don't understand how so many people think it's not a disastrously bad idea to be introducing new dependencies in random executable code.
Those other languages make it hard to add dependencies for a reason. They want people to have to explicitly spell out the dependency tree in one place so we don't have bullshit surprises like this.
It's not a "feature" that javascript plus NPM doesn't, it's a vulenerability due to a fundamental design gap.
sysop073@reddit
Oh, then I misunderstood; that's exactly what I thought they were saying.
Nooooooooo no no. We're not giving languages like C credit for having terrible package support as though they predicted this problem 50 years ago and heroically avoided it. Most languages without package support just never bothered to implement it, they didn't consciously decide to leave it out.
It's perfectly possible to use third-party packages securely, I have to go through it on a regular basis at work, it's just hard so amateurs don't bother. People that use third-party dependencies in languages without support for it are just forced to check in a copy of the third-party code they can point their compiler at. Typically they do this without reading a single line of the code, and also never bother to update it, so this isn't exactly what I would call a win over proper dependency management.
RirinDesuyo@reddit
C# for example is pretty easy to add external dependencies, but developers don't do this most of the time. This is because the stdlib is very comprehensive enough that you devs have to double think adding a dependency is worth the maintenance cost or just creating the code yourself. You don't need to pull on-off libraries like these despite installing dependencies in nuget is as easy as js, usually you pull dependencies that deal with more complex tasks or domains (e.g. image manipulation, document parsing, web servers etc...). You can even see this on libraries published on nuget where the dependency tree usually collapses back to either
System.*
(BCL) or a first party packageMicrosoft.*
and never really goes as deep as npm packages do.5gpr@reddit
You're absolutely right, but even in languages with proper dependency management, I question the programmer who uses third-party packages for (famously) left-padding a string or similar.
dodeca_negative@reddit
Totally makes sense as long as you never think about the consequences of your actions
sysop073@reddit
...right. Is that the part people were confused about, that lots of people are lazy and do whatever is easiest to solve the problem right in front of them? I thought this was widely known.
Whispeeeeeer@reddit
But a good developer should always be cognizant of the maintenance load of a dependency. Dependencies require updates, potential API changes, etc. It might be easier, but it's not necessarily a good idea.
Not to mention, a lot of these packages are basically micro versions of functions within
lodash
which solves all of this more elegantly. And with tree-shaking I don't need to worry about the overhead.djnattyp@reddit
It's also confusing for people who use languages with core libraries that provide more functionality and package managers that actually thought about security.
shevy-java@reddit
Great find. The:
and:
actually reminds me of left-pad.
JavaScript is such a horrible joke of a programming language. I can't decide whether PHP is even worse nowadays.
lechatsportif@reddit
php is still worse. Javascript the language is still much better than Javascript the community.
Somepotato@reddit
well, JS has both a left pad and isArray function, so
cdb_11@reddit
The npm culture really is just crazy.
https://github.com/babel/babel/pull/1559
This was the entire source code at version 1.0, at the time this dependency was introduced:
This guy just took some random code from a large project, and moved it to his own package. When I first saw this, I was legitimately convinced he was trying to pull off something malicious. And lo and behold, now his packages got actually compromised.
teslas_love_pigeon@reddit
sindresorhus is the type of developer that would do really really well if he wasn't part of the web ecosystem and focused on something more productive than tilting at JS windmills.
Ecstatic_Scratch_717@reddit
Damn, you've planted the seeds of conspiracy in my brain.
cdb_11@reddit
To be clear, I'm not saying this guy is a malicious actor. He's not just some random guy as I believed initially, and maintaining hundreds of tiny little packages that don't do anything is just his entire thing. I just can't comprehend why anyone ever thought that going along with this was a good idea. It looks suspicious as fuck to me as an outsider, but even if it was done by reputable people motivated by their misguided good intentions, it should still be obvious to everyone that it's a disaster waiting to happen.
relentlesshack@reddit
It's a result of the DRY method IMO
idoncaremuch@reddit
DRY means Don't Repeat Yourself.
It's not Don't Repeat Any Code Snippet Anyone In This World Has Written Before.
LoL
cdb_11@reddit
but reinventing the wheel, or something. do you actually expect me to write six lines of javascript? this is ridiculous, it's literally just like assembly and punchcards
relentlesshack@reddit
True. I should have said their interpretation of DRY
Zomgnerfenigma@reddit
No you don't have to. DRY is something subjective very vaguely defined.
jared__@reddit
Just wait for the AI slop to make this infinitely worse
wasabichicken@reddit
Incidentally, JS is probably my #1 contender for language best taken over by machines. No human deserves to write code in that mess of a language.
aykcak@reddit
Just an oroburos of lazy ass packages rimjobbing each other, creating literally millions of unchecked JS files and dumps them right next to your code
Atulin@reddit
A large part of culture around NPM is portfolio padding. You make 70 one-liner packages, include them in 10 bigger packages, convince people to use them, then add "author of NPM packages downloaded 17 trillion times" in your CV
Any_Obligation_2696@reddit
It’s lowest common denominator programming, not for lack of skill but experience. Web development is the most approachable so people learn and often never improve in that space.
CosminPerRam@reddit
Gone, got removed.
Whispeeeeeer@reddit
This particular exploit isn't necessarily an issue with NPM's implementation. These packages are popular and the maintainer was "pwned" due to a scam 2FA e-mail. Some of his packages are - admittedly - pretty ridiculous. Like is-arrayish has a bizarre amount of weekly downloads. Especially when JavaScript has
Array.isArray()
method these days. NPM has a strange history of micro-packages that tend to make these exploits easier to hide. I think the main issue with NPM is culture:SanityInAnarchy@reddit
Okay, I'll bite:
That only works for arrays. Maybe that's sufficient for your use case, and admittedly the readme isn't doing any favors:
Okay, sure,
Array.isArray
would returnfalse
in that case, but why do you need to inherit from an array, especially with prototype inheritance?Maybe this is a little more obvious with something like jQuery. Open this page in Old Reddit, open the JS console, and
Arary.isArray($('p'))
is false, butisArraryish($('p'))
would be true.But okay, maybe that's jQuery being jQuery, and we don't have to put up with jQuery anymore. After all,
document.querySelectorAll()
does a lot of what you want jQuery's$
to do, and returns a normal array.But unfortunately, some of this madness is baked into the language at a level that's harder to remove:
document.body.childNodes
is aNodeList
, which is arrayish, but not actually an array.So, sure,
is-arrayish
is tiny. But this is probably what you actually want, rather thanArray.isArray
... and it's long enough that you wouldn't want to copy/paste that every time, but also short enough that you wouldn't want to pull in a giant pile of other dependencies just because you wanted that one helper function.So I guess you could say the root cause is some ridiculous language-level design decisions in JS that make a function like this still a good idea. Or, culturally, the problem is that so many popular libraries are happy to take a dependency on some tiny library by some unknown dev... but I don't think that problem is unique to NPM.
cdb_11@reddit
First of all, you very likely don't actually need it at all. It's overly generic, and arguably the only place where it might really be needed, is public libraries that want to work for everyone. But in your code, you don't have to care about being generic. You only have to do what is needed for your code base. And only when
Array.isArray
no longer works for you, you write your own utility function that you control and does exactly what you need, and then you simply find-and-replace.Build up a library of such functions over time, and copy it over to new projects. You could make it a real package, but then you lose flexibility and you can't easily change the code and interfaces without the risk of breaking your other projects. Public libraries don't have this advantage. With a private library you never have to worry about the issues that third party dependencies bring in -- you don't worry about updating it, about breaking changes, about whether it gets removed or compromised. Of course there are few cases when it still might be worth it. But with your own code, the worst thing that can happen is that you have a bug, and then you fix it, just like anywhere else in your code. You could use existing libraries as a starting point, I believe virtually all of them are licensed under MIT, so you can just copy them to your library.
By the way, I swear I saw people having an argument in some JS library about whether NaNs should be considered a number. Do you honestly want these people to make decisions how your code should work for you?
Whispeeeeeer@reddit
That's a great write-up and my comment was coming from a bit of ignorance as to why someone might do this. But I would say that it's still ridiculous to have an entire package dedicated to this one purpose. In other languages, they typically have helper libraries to "polyfill" these missing pieces of the vanilla features of a language. The JS equivalent might be lodash.
I would argue, as well, that if you're trying to check if something is array-ish, your code is probably pretty ugly. If you're consuming an object which isn't natively a JS array and is - instead - a NodeList you should handle it as a NodeList rather than trying to treat it like an array. Idk. I'm perhaps a little pedantic, but I just get the ick from this kind of programming. Who is grabbing potentially multiple types of lists and treating them the same? Isn't a NodeList fundamentally quite different from an array of Nodes? In Java, you can treat a LinkedList like an ArrayList using the List object type because they share the same parent properties. But obviously JavaScript isn't doing that. So they shouldn't be treated as the same type.
I think it's far more reasonable to find a snippet on StackOverflow that can do that rather than pull in a dependency for something that is relatively trivial.
Gil_berth@reddit
You can use the array method forEach() to iterate over a NodeList. If you need more methods of arrays, you can convert a NodeList to an array using Array.from(). All this can be found in mdn in the first screen of the NodeList article, but people rather download a npm package than read documentation...
SanityInAnarchy@reddit
Erm... that solves a different problem than the one this library does? This is about detecting if it's like an array (which includes weird things like NodeList). Once you know it's like an array, you can of course do all those other things with it.
balefrost@reddit
But to be fair, it only checks a very small number of things to determine that it's "array-ish".
https://github.com/Qix-/node-is-arrayish/blob/master/index.js
I mean, I can just paste it here:
Something is "array-ish" if it has:
length
propertylength
is > 0splice
functionAnd there's some additional special-case handling for strings, which seems odd to me because Strings have length properties and indexing operators, and otherwise seem to be array-ish to me, but I guess not in this worldview.
So what's the use case for this function? Presumably I want to know that I can use an arbitrary value as if it is an array.
So like maybe I want to do something like:
I guess that works in a bunch of cases:
But what about this?
Well, I guess we can make it happy by forcing the issue:
So like, if
isArrayish
won't even tell me that the value will work withArray.from
- perhaps the simplest function that accepts array-ish values - what good is it?But I'm really getting hung up on the or a
splice
function part. What does splice have to do with anything? Splice is explicitly a mutating operation. But there are a ton of uses of array-like objects that don't require mutation (Array.from
being a good example). So... why even look forsplice
at all? Is it a hack to be more inclusive of array-like objects whose length is 0 (since there won't be a property called-1
)?Like, I get the idea that dynamically-typed languages employ informal protocols. If it looks like a duck and quacks like a duck and all that. But in order to be useful, you have to define what "duck-ish" means. And if you want "duck-ish" to be generally useful, you need to define it in such a way that it's useful to a wide variety of use cases.
It looks to me like
isArrayish
was maybe useful to the author in their other libraries, so they broke it out into a standalone package. It doesn't look like it was "designed" so much as "hacked together a bit at a time". It certainly doesn't look generally useful.Like, I don't know that this particular library was the inspiration, but it certainly seems like it could have contributed to the wonderful farce that is https://github.com/jezen/is-thirteen.
SanityInAnarchy@reddit
Because when you're expecting the argument to your function to be kinda like an array, you probably don't expect to iterate through it character-by-character.
Like, suppose you had a function that could be called like this:
You could check
Array.isArray
, but you want to be able to support other things likearguments
lists orNodeList
or whatever. Calling the function like this:...is probably an error. Or you could even make your function a bit more ergonomic and special-case that, since the majority of the time, someone probably just wants to ping a single host to see if it's up, and not set any of the other options.
Well, here's when it was added. It looks like it was added with the
length
check.I don't know why this specifically, but my best guess is that this is to avoid things that merely have a
length
property (since plenty of things have lengths and aren't arrays), but still allow things that merely adopt a bunch of relevant Array properties, either by using__proto__
to inherit from some existing array object, or by using worse hacks likeObject.assign
(a bunch of early JS libraries implemented something similar), or to support mocks, etc.splice
would make sense as a relatively-unusual method name, solength
andsplice
both strongly indicate that this is trying to be an array.But yep, it's a hack:
And I think you make a good case that, often, someone reaching for this really wanted something iterable, which is what
Array.from
accepts... though, again, I think you'd very often want to special-case strings.balefrost@reddit
I guess it depends on what the function does. Both of these are reasonable-ish:
I guess my point is that, for some uses, strings are array-ish. Your point is that, in other cases, you want to treat strings as not array-ish. Those both seem valid in different contexts. But personally, I think I'd err on the side of the less-restrictive version. If a caller also wants to prohibit strings, they can opt to do that. Or there could be a different helper function with a more precise name.
isArrayish
seems to promise something other than it delivers.SanityInAnarchy@reddit
I mean, most likely you're treating it as an iterable instead. (Java has this idea as the
Iterable<T>
interface.) Depends on the use case... though I also can't think of a single time I wanted to treat something like aNodeList
, back when I was writing code that actually dealt with those enough for this to be annoying. Either I want to pretend it's an array, or I want to turn it into an array.I think this is probably the right way to do it, though I'm not sure lodash would really fit the modern approach. But with JS, tiny packages makes a certain amount of sense. Keep in mind that every bit of code in your app, including all of its library code, is getting shipped to the client every time someone wants to just load a webpage. "Compiling" a JS app is basically just
cat
ing it together in the right order, and then minifying it.Lodash adds 4kb to every page load, even if you only need a single function out of it. Plus some extra time for the client to gunzip and parse it. Oh, and it's 24kb for the full release. Plus, for better or worse, NPM handles the diamond dependency problem by allowing multiple versions of the same library to be "linked" into the same app. You can even reference multiple versions in the exact same source file. All of which means, if two popular libraries depend on two different versions of lodash, suddenly it's 48kb... and so on.
But even the dumbest of JS "compilers" can figure out that it only needs to include libraries that you actually explicitly depend on.
So even if it's stupidly wasteful to have to download hundreds of tiny dependencies onto a dev laptop, single-function packages, at least at a certain point in time with certain limited dev tools, could've led to smaller JS "binaries", and thus faster page loads.
I think modern JS tools try to do a little better here, but JS makes it hard because of how absurdly dynamic it is. But Typescript completely solves this -- the ts compiler is perfectly capable of detecting unreachable functions and stripping them from a production build. I think it also gets rid of most of the reasons for a function like
is-array
, too.I'd much rather take a dependency than this. Gives you a clear license, authorship, and a way to update it.
But these days, I'd rather add a bigger library.
rdtsc@reddit
https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking
SanityInAnarchy@reddit
I know it's a long post, but I did address this:
Also, if you look at the second sentence of the thing you linked...
Historically, this allowed it to trim modules, but that still only gets you to a function per module.
billccn@reddit
querySelectorAll()
doesn't return an array though. It returns aNodeList
which is another legacy thing.MrDilbert@reddit
Fucksake, can someone make NodeList implement Iterator so we can be done with this?
SanityInAnarchy@reddit
My mistake! I thought
$$
in dev tools was just an alias forquerySelectorAll()
, but it actually turns sit into an array.greenstake@reddit
Use TypeScript and the problem becomes a very tiny pool you can handle yourself since you'll know it's a jQuery thing or a NodeList or what have you. With TS you rarely need to call something like isArray in the first place.
But you make a good point about the issues that JavaScript has. I'm sure there's similar rough edges with TS. Is the issue historical APIs, or underlying language issues?
SanityInAnarchy@reddit
I think it's both.
But yeah, TS solves a fair amount of this. I mean, to start with, you're probably not bothering with the kind of polymorphism people used to do, where you'd have a single function that can take a string or an array or an object. And I've found I don't care nearly as much about any sort of defensive runtime type-checking when TS can know I passed an array at compile time.
Middle_Citron_1201@reddit
Those are all iterators. This isn’t a language level limitation. Asking if something is array-like is only useful because that was the iterator convention before we had a real iterators.
We’ve had real iterators for 10 years now.
There is no need to be dynamic in this case. Even if you didn’t want to look at things as iterators, the two examples you listed make up 99% of the use cases for this function, and checking for them explicitly is a lot clearer than using this weird function, if you actually have a need to do that which I’m sceptical you do
SanityInAnarchy@reddit
Problem is, there are iterables that are not array-like and probably shouldn't be treated as such. For example,
is-arrayish
explicitly carves out an exception for strings -- you can iterate over a string to get each character, but that probably isn't what you wanted.The point of being dynamic here is a level of polymorphism that was probably more popular before Typescript, where you might have a function that might do different things if you give it a string vs an array vs an object.
It's borderline, but certainly at the time, and I think still today, this function still saves enough boilerplate to be worthwhile, even if I wish the language didn't need it.
xTheBlueFlashx@reddit
I created an object with custom .length and .splice properties, and the function returned true.
Caraes_Naur@reddit
The JS community is overall low-skill, has a huge chip on its shoulder, and is still trying to convince us that this DOM-fiddling toy language can run with the big dogs.
NPM is:
This is what happens when script kiddies implement language infrastructure in self-built clean room.
Zoradesu@reddit
Aren't a reason some of these small packages are downloaded a bunch is because they're dependencies of other popular libraries? While I think these micro-libraries are pretty ridiculous in JS, I do think their download counts are somewhat inflated due to this, especially since packages and their dependencies would be downloaded a bunch in CI
luxfx@reddit
They are. I just did a scan in my project and eslint, nodemon, jest, and mongoose were the source of almost all hits
CherryLongjump1989@reddit
They're downloaded so much because of cloud-hosted CI/CD vendors. Especially since the most prominent packages here are for formatting terminal output, so this stuff is being installed to set up development tooling to run unit tests on some random CircleCI machine every time someone pushes up a pull request.
robrtsql@reddit
Exactly.
I just ran
create-next-app
to create a Next.js project, andis-arrayish
found its way into the dependency tree. Here's the chain of dependencies:The noteworthy part is that
color
and everything to the right of it is maintained byQix-
. I have no idea what possesses someone to do this.Ignisami@reddit
When you take DRY as a religion instead of merely reasoning-backed advice. plus a little bit of stats padding, I guess?
INeedAnAwesomeName@reddit
what
Able-Reference754@reddit
Agreed, but I also think on top of locked dependency files in lockfiles they should also have locked signers so that any new version of a locked dependency that isn't signed by the same author would be easily apparent.
rubeyi@reddit
Totally. It's hard to talk about this stuff without it just sounding like "back in my day..."
but as a polyglot and someone who came of age before JS took over, I think a lot is wrong with the engineering culture around web dev.
Case in point, my "favorite" GitHub issue: * Node occasionally gives multiple files/folders the same inode
In summary, Node devs were storing filesystem inodes as numbers, and then the inodes (which are not numbers) were subject to precision loss.
A couple of my favorite comments:
hey, me too! samesies!
man, that'd suck... if they were numbers!
Again, these were not garden-variety web app devs, they were the maintainers of nodejs. It took 3 months of bickering to land on a fix, and the fix involved continuing to store inodes as numbers. (It just so happened that JS added a BigInt library around that time.)
The problem is the JS ecosystem, and the average level of talent, and there's no fixing that. All you can do is minimize the amount of libraries you drag in, and from time to time (like I had to today) rip a bunch of things out because you woke up and, yay, NPM has crypto rootkits now.
vengeful_bunny@reddit
Most JS repo makers don't upload the node_modules tree, to save space, and in the hope that when the consuming dev runs "npm install", and they get the latest versions, the newer versions are better. That's a problematic assumption. I'm not recommending it to others, and these are private repos so perhaps it's not relevant to NPM packages, but I upload everything to my repos including the node_modules tree. I've gotten burned too many times when cloning to my cloud servers because some upgraded package broke something else critical to my build.
Shne@reddit
Except that's exactly what package-lock.json has done for a long time now.
acetesdev@reddit
Those small packages are there because it's literally impossible to know what standard JS code does
shevy-java@reddit
Was not the promise of 2FA more security? I actually retired due to 2FA because I could not want to be bothered to now invest more unpaid time into my ruby gems to go through that hassle as an additional road block, but this is kind of hilarious. And sad.
AyrA_ch@reddit
The security of 2FA depends on the common sense of its user. You may see the problem here.
cake-day-on-feb-29@reddit
It's not any different than a password, then.
Dustin-@reddit
that's it that's the fix
HittingSmoke@reddit
Largest NPM compromise in history so far.
andrewfenn@reddit
Could happen to any language and yet it's always them..
RackemFrackem@reddit
Yes, "in history" generally means "in history so far" and not "in history and future".
I get it, funny Simpsons joke, but it's really not funny when it shows up in every fucking reddit thread.
HittingSmoke@reddit
Steal any good baseballs from kids lately?
Jonno_FTW@reddit
The S in NPM stands for ~~security~~ spearphising vulnerability
simonraynor@reddit
Largest *known" NPM compromise so far
freecodeio@reddit
* runs
npm run update
out of pettyCalm_Top5442@reddit
What’s really scary is how these supply chain compromises are almost impossible to defend against at the individual developer level. You can audit your own dependencies all day, but once something slips into a widely used package, it spreads everywhere almost instantly.
Feels like we need better ecosystem-level solutions — automated dependency scanning, stricter package publishing checks, maybe even AI-based anomaly detection for malicious updates. Otherwise, this cycle just repeats: wait for the compromise → patch → repeat.
Advocatemack@reddit (OP)
This is a little self-promoting. Aikido Research team publish all our findings on intel.aikido.dev usally this takes 30 minutes from when a malicious package is uploaded (it is a AI based detection pipeline we use)
We created an open-source tool called SafeChain https://www.npmjs.com/package/@aikidosec/safe-chain This wraps around NPM and each tiome you run npm install it checks for malicious packages and blocks them. So in this case it would have prevented you from installing malicious packages from 30 minutes after the malware was published, (the malicious packages were live for 4 - 6 hours)
NoSweet595@reddit
How are the affected versions identified and published at the source? I see the maintainer's own list of affected versions in social posts but I can't tell whether sources corroborate it or merely reformulate it.
Even if Aikido did the whole threat intelligence on it, there should be a caption on the affected versions table that indicate the source, even if it's their own intel.
freecodeio@reddit
what I've learned from modern attacks is that as long as you don't have a crypto wallet you're safe
todo_code@reddit
What I've learned is thank God for crypto. All those idiots can just go be in a corner and not effect me.
wasabichicken@reddit
But they do. The cryptbros' number crunching amounts to some 68 TWh annually, or about the energy consumption of a medium-sized European country. That energy is heating the world you and I live in, contributing to global warming.
Like leaded fuel, it's one of the things I wish had never been invented.
phlipped@reddit
note: the energy consumption (and corresponding heat release) is not a significant contributor to global warming in itself - it's the CO2 that gets released to make the energy in the first place that causes global warming
freecodeio@reddit
yes because all crypto miners run on clean energy like windmills
phlipped@reddit
Sigh, not what I said or implied.
Op originally implied that the heat from the energy being consumed contributes to global warming, which is not true. If it WERE true, then renewables wouldn't help combat climate change - they release just as much heat energy as any other source.
Op has since edited their comment to clarify that it is the PRODUCTION of energy which causes global warming, which IS true most of the time (i.e for carbon-fuel based energy production).
Rattle22@reddit
If we want to be technical about, the energy does contribute a whopping 68 Terrajoules of warmth to the planet every year. Pretty sure that's an insignificant amount, but it does contribute.
Halkcyon@reddit
Surely all those datacenters in *check notes* Texas and Louisiana are depending on green energy!
D3PyroGS@reddit
"I swear I didn't kill him, Your Honor. I merely pulled the trigger. The bullet should be the one serving time."
JM0804@reddit
You're getting downvoted for this, and maybe it's a bit pedantic, but you're right (about the direct heat generation at least), and perhaps there are some people who don't understand the issue is the GHG. I appreciate you mentioning it.
Halkcyon@reddit
And why is that CO2 being demanded...? Oh right, because they want to generate random numbers and are paying energy producers untold sums of money.
geon@reddit
I really don’t understand how proof-of-wastefullness looked like an appealing solution.
wottenpazy@reddit
I don't like Justin driving to work so he can click around on a computer all day, does that mean I get to stop hom from doing that? How about banning people from going on vacation? No more travel unless it's strictly required? Carpool to the grocery store?
Why are intervening in the most fundamental market (energy) to stop this growing industry and not the other thousands of energy consuming ones? Do we need to ban datacenters too? Go back to dial-up?
The whole argument is nonsensical.
What I can agree on is energy consumers paying a progressive cost for using the electricity. That makes sense. Make big energy consumers pay more per watt. How about we start there rather than just banning specific industries (which is a ridiculous argument to begin with).
gefahr@reddit
Think we'll have to agree to disagree on that.
wottenpazy@reddit
Luckily cat photos can also be stored on a distributed blockchain more permanently than relying on a single entity. Your cat photos can now be stored indefinitely thanks to the collective efforts of humankind and our new intergenerational technology.
gefahr@reddit
I know you're trolling, but, who is paying to host and serve someone else's unreadable cat pictures?
You're just describing a git repo backed by torrents, but with more compute wasted.
wottenpazy@reddit
I'm not trolling I just occasionally have to point out ridiculous thinking because I think Bitcoin is extremely important.
I don't understand this question and your torrent + git repo analogy doesn't work since torrents don't store the actual file data and bad actors can easily poison the data. There are other decentralized storage mechanisms (Filecoin) but I can't guarantee the longevity of Bitcoin (the example was slightly tongue-in-cheek since Bitcoin is better designed for storing receipts than jpegs, which is important enough).
gefahr@reddit
But torrent nodes do store the actual data, trackers don't.
Git inclusion is because git is a blockchain, and gives you the content-addressable piece with its hashes.
wottenpazy@reddit
Git is not even close to a blockchain, it's just a Merkle tree without any decentralized consensus mechanisms. Someone still has to merge. Torrents do not have any of the necessary security mechanisms to block bad actors from poisoning swarms since there's a substantially lower cost to the bad actor to do so than the good actors maintaining the file. Bitcoin solves both of this and is already deployed around the world and has been working for 15+ years.
balefrost@reddit
I guess it remains to be seen if anybody's wallet was affected by this particular attack, but people certainly have had various crypto assets stolen by malicious actors, with AFAIK no recourse unless the majority of nodes decide to fork.
I wouldn't call that "working flawlessly".
stormdelta@reddit
Bitcoin even more so than most cryptocurrency incentivizes wasting power that scales not with actual use (the actual use doesn't even scale at all, a separate problem), but with the price. Which is the thing nearly every cryptobro wants to go up, even though it has no effect on the actual supposed utility. A normal datacenter scales energy based at least somewhat on actual loads and usage.
Worse, crypto mining hardware and setups are so specialized that they have no other purpose. A normal datacenter typically has more general purpose hardware that can be used for many different kinds of software loads.
And all of that is assuming I think bitcoin has any reason to exist, I very much don't. The only purpose cryptocurrency serves is illegal transactions, and while not all illegal transactions are unethical, monero addresses those niche edge cases better than bitcoin does and isn't as prone to speculative manipulation/gambling.
wottenpazy@reddit
If the price goes up then people are finding it more useful. An auditable, truly fixed supply of something is extremely useful, perhaps even in ways we cannot imagine. The fact that you can move it around digitally is just a bonus add.
I won't address the facetious argument that bitcoin just facilitates illegal transactions since I just demonstrated a way that it does not. Do you think the boomers are buying Bitcoin ETFs to pay for drugs and crime? There are thousands of individuals and companies stockpiling it as collateral to borrow against because it is such a hard asset.
Monero is not a fixed supply asset nor do I have any problems with it existing. Maybe one day Bitcoin will get an zero-knowledge proof L2 privacy layer, that would be pretty cool.
stormdelta@reddit
Useful for what? It sucks as an actual currency: besides all the security problems that have already been covered extensively, bitcoin in particular literally can't scale, is very slow, and very expensive to actually use.
It's so bad at being a currency even compared to other cryptocurrencies that it's easier to buy grey market drugs now with monero than bitcoin.
And you wonder why people think you're in a cult.
No, you didn't. You just said it was useful without even giving an example.
ETFs are traditional finance. Meaning these people aren't even actually buying bitcoin, so whatever properties it supposedly has or enables aren't even relevant. The SEC should never have approved these, but it's become compromised and fraud is being allowed to run rampant (cryptocurrency is just one of many examples).
No, they're engaging in speculative gambling betting that the price will go up. That's not the same thing at all.
hawaii_dude@reddit
It bothers me that leaded fuel is still used.
wottenpazy@reddit
Since when do you get to dictate what other people use energy (they are paying for) on? Crypto may not matter to you, but it can matter to someone else.
Ok-Interaction-8891@reddit
Yes, like human traffickers, drug and arms dealers, and other black market transactors.
The point is that the mining and transacting of cryptocurrency is a massive waste of energy for a currency that doesn’t need to exist, that isn’t better than previous currencies, and that makes it that much harder to direct energy and resources to where they’re actually needed. Burning energy on crypto is irresponsible and foolish, particularly when over six hundred million people live without electricity and about one third of all people live without a clean source of fuel (like electricity) to cook with. That is to say, they have to burn solid fuel to cook food; yikes.
Playing this little game where we pretend that what we do doesn’t have downstream consequences on many other people and the planet is childish and ignorant.
wottenpazy@reddit
Luckily Bitcoin mining is the best way we've discovered to get electricity to those people since it makes energy development more cost-neutral by incentivizing energy production.
stormdelta@reddit
Even if what you said made an ounce of sense, that argument only holds if bitcoin fails later and frees up the excess energy production for something actually useful.
If you're going to just make shit up anyways, at least try a little harder.
wottenpazy@reddit
I love the bot downvotes for pointing out the existing social contract that's entirely predicated on the free market of energy. In any case good luck banning it, your perfect society of China couldn't even get it done.
FeepingCreature@reddit
crypto is basically a global involuntary bug bounty program.
paul_h@reddit
Quoteworthy!
amakai@reddit
That you can crowd-fund by opening a wallet!
teslas_love_pigeon@reddit
These idiots have figured out how to garner political power and favors tho :\
robertbieber@reddit
Well, not directly, but now thanks to crypto they can do ransomware attacks on the institutions you depend on and extort them for huge sums of money
ArtOfWarfare@reddit
Meh, then they get hacked themselves and it’s stolen. The enemy of my enemy is my friend?
stormdelta@reddit
The smart ones cash out anything they manage to steal.
ExtremeCreamTeam@reddit
affect*
or
have an effect on*
todo_code@reddit
I meant have an effect on, on my phone, going quick
BugBaba_dev@reddit
Crypto: where your wallet cries faster than you can say HODL 😅
Decent_Ad_9615@reddit
affect*
Ironic.
hishnash@reddit
if you have deployment keys, for AWS etc they might well haply go after these and then spin up a load of servers under your account costing you $$$.
Unlikely-Rock-9647@reddit
At a previous company I worked at one of the SRE’s left a package behind that caused the servers to start mining crypto when he was fired. Fortunately he was an idiot, and instead of very slowly ramping up, which might have gone unnoticed for a long while, it spiked them to 100% immediately.
MassiveBoner911_3@reddit
They don’t even really bother with anything else anymore lmao.
Ashamed-Simple-8303@reddit
I think wallet here would be fine as it only attacks transactions. Does anyone actual use crypto to make this worth the effort and risk?
stormdelta@reddit
That's the one positive thing I'll say about cryptocurrency - it attracts fire for security vulnerabilities that might have otherwise been used to target something that was actually important.
tied_laces@reddit
Desktop! Mobile crypto wallets are much safer because they check for jailbreaking/sideloading
nath1234@reddit
Bonus: environmentally sound not to be supporting the algorithmic equivalent of pouring electricity down the drain.
Advocatemack@reddit (OP)
haha, kinda true. This could have been much worse but crypto is just easy.
halting_problems@reddit
All i have to say is this could have been wayyyyyyy fucking worse and 99% dodged a bullet
itsa_me_@reddit
Yeeesh. Kinda reminds me of the supply chain attack from a few months ago that was caught by a guy who noticed his terminal was taking a fraction of a second longer to load or something like that.
Living_male@reddit
I missed that, do you remember any specifics I can search for?
Kissaki0@reddit
https://fastcode.io/2025/09/02/the-hidden-vulnerabilities-of-open-source/
^ great recap of that whole ordeal
Living_male@reddit
That was a great read!
Living_male@reddit
Thank you!
binariumonline@reddit
https://en.m.wikipedia.org/wiki/XZ_Utils_backdoor
Living_male@reddit
Thanks!
marcusroar@reddit
https://www.nytimes.com/2024/04/03/technology/prevent-cyberattack-linux.html
Living_male@reddit
Thanks, that'll be a fun read tomorrow!
marcusroar@reddit
Open ssh compromise - not npm specifically
Kissaki0@reddit
https://fastcode.io/2025/09/02/the-hidden-vulnerabilities-of-open-source/
^ great recap of that whole ordeal
Ok-Quarter-8787@reddit
I found out about this attack because I had just run ncu; npm i on a project I am working on and the vulnerabilities were printed on the screen. I quickly deleted all node modules. But today i ran the installer again and ran ncu again in case packages had been updated. No updates. I reinstalled everything and ran npm audit and I get 0 vulnerabilities??? Have the packages been fixed?
pat_trick@reddit
Another lesson in "don't click on shit in your email, always manually visit the site in question".
Middle_Citron_1201@reddit
That advice is about as useful as abstinence only education
Sure. It works and if you’re someone who’s actually going to do that then that’s a good you have protected yourself.
It is not actually use useful advice to give people in general if we all know, it will never be followed
pat_trick@reddit
It's one step of many, not the only tool in the entire toolkit.
wottenpazy@reddit
pat_trick@reddit
Yeah they definitely don't make it easy.
wottenpazy@reddit
I wouldn't mind it being harder as long as it wasn't handled through an email link. A major phishing attack is inevitable, everyone is getting trained to mindlessly click on those emails.
lturtsamuel@reddit
Today I learn: you can hijack core APIs like fetch in JavaScript. What a wonderful language for web development.
Steadexe@reddit
Same in C#, Java, Ruby, and I think many more
redditrasberry@reddit
bit harder in Java/C# .... python, ruby, etc definitely
iflugi@reddit
How would one actually hijack core Java API? AFAIR Java, that doesn't seem to be possible.
saichampa@reddit
Does NPM not have package signing?
Pindaman@reddit
Even if so, in the Python world it's not uncommon to pin a package on a minor version e.g. 0.9.*
WJMazepas@reddit
Does old versions of the packages would be fine? Im checking here and we have the debug package, but the latest update was 3 months ago
freecodeio@reddit
this is just the next wave of companies learning the "why you should version-lock packages" lesson the hard way
Fit_Sweet457@reddit
I don't get this. Version-lock or not, if you update at the wrong time, you will get hit by this. Do you expect companies to verify every single NPM module they're using and then also check every single update to those modules? Because otherwise you're still relying on luck.
freecodeio@reddit
What's not to get about it? Version locking means you're gonna have bad luck once, not version locking is playing with your luck every-time there's an update.
teerre@reddit
Not updating means you're vulnerable to all known exploits. Updating your toolchain should be the default
emperor000@reddit
But that just makes you vulnerable to all unknown exploits...
teerre@reddit
I meant known exploit for hackers, not users
emperor000@reddit
I get you. I'm just pointing out that when you update, especially automatically, you're just updating to vulnerable versions that you don't know about yet, but hackers may already or soon will. So there are definitely risks to updating aggressively/greedily.
teerre@reddit
That doesn't make any sense. Of course theoretically any software will possibly have vulnerabilities, but that's irrelevant. The fact is that updated software has vulnerabilities because updates are very often precisely to address vulnerabilities
emperor000@reddit
I'm not sure what you aren't getting. You said updating should be the default, as in, everybody version locked to an old version of these packages should have updated them to the new compromised versions...
This is a perfect example of why updating as aggressively as possible is not really a good default.
teerre@reddit
Do you understand the concept of an exception?
emperor000@reddit
Sigh. Never mind.
Fit_Sweet457@reddit
I'm not arguing against version-locking, I get why it's best practice and I do it too. The point I don't get is how it's supposed to help with attacks like this.
That's the first time I've ever heard of a policy like this, and I've seen a quite a few projects at different large companies. I have a hard time imagining how one could do this for larger projects like React or Next.js without having to dedicate multiple full-time employees just for reviewing dependencies.
freecodeio@reddit
You are not verifying for functionality, you are verifying for obfuscated code, suspicious code, use of networking. And can be done once per package.
gefahr@reddit
I think because of some of the features of JavaScript, it's quite hard to statically assert something like "this package doesn't use networking."
I haven't read the details of this compromise yet, but doing something like overriding window.xhr to turn it into a shadow proxy for yourself is quite doable in a few lines of code.
Skeik@reddit
I work at quite a large company in the energy industry and this is what we've done my entire career.
ROGER_CHOCS@reddit
It's what we do with jfrog.
doyouevencompile@reddit
yes, doesn't matter if you version lock. you run npm install and you are done.
emperor000@reddit
If it is version locked then you are much less likely to get hit with a vulnerability like this.
MSgtGunny@reddit
We run npm pulls through a third party tool which caches those packages for faster retrieval. So the underlying package changing on npm for a version doesn’t have a direct impact, no.
SkoomaDentist@reddit
The point is to version lock when you start development so that by the time anything goes public, there will have been plenty of time for any exploits to become public knowledge and thus easy to avoid.
freecodeio@reddit
I find blindly updating packages a bigger hazard than being ready to update for vulnerabilities. Github alone sends you notifications of new vulnerabilities when they become public.
fire_in_the_theater@reddit
what if they version-locked on the bad version?
freecodeio@reddit
same as if they updated to the bad version, look up news and check if you're affected
Advocatemack@reddit (OP)
Old versions are fine. Only packages that have been updated today are malicious and NPM and the maintainer are now aware so they are working together to remove malicious verions..... slowly.
Spare-Sock5207@reddit
If they are fine, why were old versions (">= 0") marked as affected? Why am I getting a **84 critical severity vulnerabilities** treatment if my `node_modules` is not affected?
the_horse_gamer@reddit
according to https://github.com/github/advisory-database/issues/6099, the list of affected versions was set to be wider than what was actually correct
SoInsightful@reddit
For fun, I checked out the is-arrayish. Apparently this is arrayish:
Not a single explanation of what this is supposed to be good for. Just "Check if an object can be used like an Array", which the object above very obviously cannot.
If you install this dependency as a direct dependency and use it in your production app, I honestly think you deserve to have a small amount of crypto stolen from your wallet.
Ashamed-Simple-8303@reddit
Left-pad all over. The entire set of packages sound like something simple you should not depend upon. But I assume some big ass libraries do and you sont even know you are using this bs.
One_Being7941@reddit
CCP again.
dodeca_negative@reddit
But I thought having an app built out of a tree of 10,000 micro packages that I mostly don’t even know I’m using was a good thing
SwiftOneSpeaks@reddit
No, no, it's much better to import a single massive library that is 10,000 times bigger. /s
This was an attack against a single dev. No language that imports outside code is safe from this. Smugness isn't security.
RRR3000@reddit
No, you shouldn't be using any package or library, I don't care how big or small it is. Either don't be lazy/incompetent and program it yourself, or if you can't, you weren't supposed to be doing it anyways. Plain HTML/CSS/JS is all that should be needed.
cdb_11@reddit
Increasing your attack surface by importing thousands of packages is not security either. The point isn't that you shouldn't ever rely on any third party code, the point is minimizing how many people you have to trust. The same way that by minimizing the amount of accounts you create on random websites you lower the odds of your data getting leaked.
dodeca_negative@reddit
It’s sad that all language ecosystems suffer from the same vulnerabilities!
Caraes_Naur@reddit
That's how you go from DRY to dessicated.
entropic@reddit
And eventually, back into dust.
sparr@reddit
This particular failure mode only manifests if you install random new versions of those packages. If you keep using the ones you built your site with, you won't suffer from this.
dodeca_negative@reddit
So once you've reviewed your 10,000 dependencies for security vulns, lock it in and never update. Got it.
sparr@reddit
Were you already doing that? If not, then it's not fair to include that here.
warreninthebuff@reddit
HTMX fixes this
subaru-daddy@reddit
speak up, warren!
Wr3ck3d4Day5@reddit
I'm here to buff the war man
Varonis-Dan@reddit
Lockfiles can slow down a mess like this, but the real headache is all the transitive deps that slip in without anyone noticing. The whole micro-package culture just makes it even easier to miss
HarveyDentBeliever@reddit
I like how no matter the complication of the overarching hack there is always a phishing email involved lmao.
kid_380@reddit
Is there anything special about NPM that makes them a frequent target? Every year there is news about it being compromised, but other package managers rarely got one.
Ashamed-Simple-8303@reddit
It is more about javascript and lack of a proper standard library. This leads lots of small helper packages used by bigger projects and hence a very high amount of targets. The small pacakes are often done by hobbyists which might not have top notch opsec
Advocatemack@reddit (OP)
Here is the Phishing email that was used. It has been sent out to lots of maintainers. I suspect we will be seeing a lot of compromised NPM accounts from this
https://github.com/orgs/community/discussions/172738
prehensilemullet@reddit
I bet it wouldn't be that hard for email providers to see if the email address appears to be impersonating various well-known SaaSes and display a warning banner at the top
AlfajorConFernet@reddit
Gmail (and many other clients) try to flag suspected phishing in a way very similar to what you said. But It isn’t trivial, attackers manage to avoid it.
BubuX@reddit
Wait, the maintainer really trusted an email from support@npmjs.help ????????????????
gefahr@reddit
No, all those question marks weren't there.
BubuX@reddit
even worse
MdxBhmt@reddit
Ignore emails, save the world.
Ocelot-@reddit
Tried googling this and searching Reddit to no avail. A. Is there a way to know if you’re infected? B. Does infection persist through browser restart and OS restart? C. Do we know if another payload can be downloaded by the malware at a later date that can bsckdoor the device?
jdprgm@reddit
these posts and articles have done a horrible job explaining this issue. if you visited a crypto-enabled site that unknowingly bundled the poisoned npm code during those handful of compromised hours, a transaction you signed via that site and a browser extension wallet could have been hijacked. afaik there haven't even been any instances of anyone actually being effected. there is no notion of "you" being infected or your OS.
Ocelot-@reddit
Thank you, I wasn’t sure what the nature of this was. I appreciate the answer
Pulseamm0@reddit
Does anyone know if simply installing these dependencies on a dev system without running any code will have compromised the system? Were there any post install scripts?
Typically I had just installed puppeteer which pulled a bunch of these deps in and then failed the NPM audit which lead me here. I was shocked to see the reports on github only posted 2 hours ago at the time.
paulomadronero@reddit
No. This is how it works:
You create a webapp and use one of these as a dependency in the front end code.
You did a prod release of your webapp with one of the compromised packages built on it.
One of your users uses your compromised webapp.
When the webapp launches, the malicious packages start doing their thing.
ClownCombat@reddit
Like, could you describe a usecase where it can affect a user, even if the website or webapp does nothing with crypto wallets?
jdprgm@reddit
it wouldn't. and it seems odd how poorly the actual issue has been explained probably just to sensationalize it. i guess they could have just forced any websites that deployed this malware to trigger wallet prompts but that would have been too sus if like rottentomatoes randomly was trying to interact with your wallet.
Dean_Roddey@reddit
So basically any (completely legitimate) web site out there could potentially infect you just by you going to it, right, because anything you load could just hijack the browser that easily? That's psycho. Browsers should not in any way whatsoever trust anything it downloads from the other side that much.
Pulseamm0@reddit
I imagine (but am not certain) that it's not a permanent "infection" and more that it'd only hijack the payment flow of the specific site that pushed the infected code to production.
I just wanted to make sure that there wasn't any post install scripts that infected the development machines as well.
missing-pigeon@reddit
Everything is transpiled, bundled, minifed and zipped before being sent to the browser. The browser has no way to verify if the code it receives came from legitimate packages, and that shouldn’t be its job anyway.
This is just one among many symptoms of modern web apps being a use case that the foundation of HTML+JS+CSS was simply not designed for.
JiminP@reddit
Ouch. First time a package I directly used as a dependency (
color-string
) being compromised.danielv123@reddit
Luckily for this one it wouldn't make any difference whether it was a direct or indirect dependency, you'd have lost your crypto either way :)
JiminP@reddit
True in terms of actual security (and I don't use crypto), but it means something for me.
I'm quite conscious about dependency footprint of my projects, and I try to "practically" minimize the set of dependencies I use. So far, the closest call for using a compromised package was
eslint-config-prettier
(I sometimes do useeslint
).This is the first time the package I used, directly or indirectly, was compromised "in a big way", and I even remember typing
pnpm install color-string
as I specifically needed that package for parsing colors, which means that "lol left-pad" is no longer a 'relevant' argument even in practice.As a npm user, other than "don't use the version that came out hours ago", there's no longer (even in practice) a safe way to use npm, and I don't think that even "don't use npm/Node.js" can be a solution as there's no guarantee that the same issue won't happen in, say, PyPI or cargo.
afl_ext@reddit
It looks like this is the wake up call for NPM to do something with the ecosystem because it looks like too juicy of an attack vector
cake-day-on-feb-29@reddit
But npm isn't really all that different than any other package platform.
The problem, of course, is the language itself. No standard library means that basics will be implemented and reimplemented over and over in different libraries. Now we have a large spam of libraries of which different frameworks use different subsets and we have hundreds of dependencies and hundreds of potentially exploitable packages.
NPM can't do anything about it aside from getting rid of JS itself (which is a good idea).
Fit_Smoke8080@reddit
Why not convince all the giant players in tech that get rich from this to sponsor the maintaining of a library like Boost or Apache Commons? Isn't ideal, sure, but better than this mess.
grauenwolf@reddit
You know the answer. The JavaScript community think they are too special for a standard library.
Fit_Smoke8080@reddit
For what is worth, there're some people that never liked Apache Commons and it hasn't been that needed now that Java has improved it's stdlib, but JavaScript just never went through that kind of evolutionary step.
piesou@reddit
Nah, there's still a ton missing. Was able to get rid of Apache Commons in kotlin though, they've got a fantastic stdlib and sport lots of great official libraries
Fit_Smoke8080@reddit
I've yet to been able to give Kotlin a shot, mobile market is slow where i am and every other offer wants Java, Typescript or PHP (awful pay) or sparely .NET (mostly legacy Framework codebases wanting to move on to other tech). Maybe if Kotlin gets an interpreted dialect I will be able to use for CI/CD machinery and automation instead of Bash. At least Spring Boot is pushing for it, so I'll eventually have a solid chance.
piesou@reddit
Java jobs need Kotlin tangentially because of Gradle plus Spring Boot & Kotlin is very popular. Gradle is not the finest piece of software, but very likely you are going to work with it.
grauenwolf@reddit
NPM could sponsor a standard library. Take all of the useful functions and place them in a single curated package with a high degree of security.
the_horse_gamer@reddit
xkcd 927
grauenwolf@reddit
No one is complaining that JavaScript has too many standard libraries.
ROGER_CHOCS@reddit
You don't know that, guy! 🙌👉
gefahr@reddit
Is there an xkcd for that? There will be soon if not.
grauenwolf@reddit
Fair enough.
starm4nn@reddit
You could even have it work similar to .net framework where there are multiple standard libraries.
If these become popular enough they can become standard language features.
Whispeeeeeer@reddit
I think they might just need to create a new subset of packages that are given a special designation. The packages should have rules like:
Other ecosystems like Kubernetes have the CNCF which basically find promising libraries/tools that get vetted by the community. They go through a process of sandbox -> graduating which basically lets users know the tools are mature enough for production environments. NPMJS could have a similar process for adopting libraries. Libraries with enough downloads/week could get adopted by the NPMJS organization and supported for things like validating new versions, maintaining, etc.
ROGER_CHOCS@reddit
Yeh but someone would have to sponsor that, which would hurt the feelings of the poor investors. It's much better to just get it all for free.
Steadexe@reddit
We should really start removing micro packages. Like why the hell do we still have more than 2000 packages in almost any starter
wasdninja@reddit
Literally impossible. It's juicy because it's used and if nobody uses it, well, it's worthless.
shevy-java@reddit
Well ... it's popular. This does not explain why its security is lacking, but people evidently use the ecosystem.
Much-Zucchini-9075@reddit
So .. how can I avoid any critical harm?
For example, I wanna setup a new Nest JS project, would it be safe?
leumasme@reddit
clicking on an npmjs[.]help phishing link, okay, sure.
and then? do you not use a password manager? do you think "huh, my password manager doesn't autofill anything for this url, let me just manually get the password out of my password manager and paste it in anyway"?
danielv123@reddit
Its shocking how many sites won't work well with password managers.
ROGER_CHOCS@reddit
I despise apps and websites that don't work bitwarden..
chalks777@reddit
According to this report only about 36% of people in 2024 were using a password manager.
Granted a software developer should know better (and I'm sure he certainly does now), but it's not really that shocking that someone doesn't have a password manager.
Kissaki0@reddit
Please don't add delay to my scrolling. It feels so stuttery, slow, irritating.
Arvid-Berndtsson@reddit
Do we have any knowledge of the timeframe during which these malicious npm packages were up?
danielv123@reddit
Thats fun, I have 15 out of 18 installed on my local machine (checked with voidtools everything). Luckily latest one was installed on the 5th so I am unaffected.
Dark_Lord9@reddit
I still don't understand why JS devs need to import this code as dependency. How hard is it to write it yourself ?
yksvaan@reddit
Looking at the names of some packages I can't fathom why they are even used. Write your own or at least copy them as local source code.
lurker512879@reddit
who/what approved the PR's, so the packages received the updates?
slvrsmth@reddit
The owner did. Via a compromised account.e
rralfaro@reddit
Hey guys. Could someone please explain whether or not is necessary to do any action after running npm install/audit fix? Am I compromised in any way? Sorry, I don't have much knowledge on this part and was apprehensive..
ROGER_CHOCS@reddit
Throw the entire in the trash. All of it.
Dry-Video5036@reddit
stop code and relax. clear npm cache for now
Dry-Video5036@reddit
stop code and relax. Clear your cache for now
ROGER_CHOCS@reddit
We use debug but I didn't say anything cuz they're laying me off soon. Fuck em.
OkArea7401@reddit
So how does it "injects itself into browser", what should infected people do? Does running npm install somehow infects browser or does this malicious code only work on the page it gets executed?
the_horse_gamer@reddit
It modifies standard library methods.
Only works on the page. And as long as you're not doing any crypto related thing, it does nothing.
fupaboii@reddit
More specifically, you’d need to be doing crypto related things on the domain that has the affected code, correct?
the_horse_gamer@reddit
yes, it hooks into
window.crypto
,fetch
, andXMLHttpRequest
on the current domain (more accurately in the current realm due to the existence of iframes, but that shouldn't matter in most cases)the first is a standard API for generating cryptographically secure random numbers
the other two are standard APIs for sending and receiving data over http. the malware checks for crypto-related requests and redirects them to a different domain.
for the largest ever attack on npm, we sure got lucky.
someone managed to find the crypto wallet address that was receiving the money. seems like they got about 200$ from this (mostly from some "granola" cryptocurrency. only one person sent ETH). I've lost the link but I'll try to find it again.
Ashamed-Simple-8303@reddit
Does npm require 2fa? I think for such high traffic packages that should be made mandatory.
babige@reddit
JavaScript is 🗑️
Hopai79@reddit
my company's security scanner prevented this from ever deploying so that was a good sign that the vendor we pay for the scanner works!
ffiw@reddit
can you provide service that your company used ?
autistic-mad-genius@reddit
Well that's not good
prehensilemullet@reddit
Crypto was just a psyop to distract hackers from attacking things of value to non-crypto users, and it's been working well
daburninatorrr@reddit
Every time I see any NPM supply chain attack related article, I am reminded of this hypothetical that I read 7 years ago
Capable_Constant1085@reddit
Johnathan Blow predicted this years ago
onephatspoon@reddit
i miss the days when anonymous hacker groups did good guy stuff.
gefahr@reddit
That's before you could monetize hacking with crypto. I was around in the 90s on IRC being a shithead online. If there had been a nearly risk-free way to get cash instead of internet street cred out of it, I'm sorry to say we probably would have. :(
NoleMercy05@reddit
AI Slop?
Nice-Information-335@reddit
why the AI summary of how it works?
not_arch_linux_user@reddit
How’s one do a check if these are used anywhere in a project?
kherodude@reddit
Well, you can track every package in the package.json file, but also you need to track the dependencies of each one.
not_arch_linux_user@reddit
Yeahh would be nice to have a tool that drill down and see
RelativeAdeptness@reddit
or
perhaps?
chalks777@reddit
even better you can specify the package you want to know about
npm ls chalk
Or if you're not sure what to worry about, you can
npm audit
which will give you a list of things to worry about.BugBaba_dev@reddit
This incident came from a maintainer account takeover, and malicious releases of popular npm packages (like chalk, debug, color, plus related deps) were pushed. The bad versions have been yanked/flagged and clean releases are being restored. There is no way to “remote-neutralise” what’s already on a machine - you stop future runs by uninstalling/locking to safe versions and upgrading.
Pattern matches recent attacks: phished maintainer -> malicious versions -> npm and maintainers remove the bad versions and mark them as unsafe -> users have to update to clean versions and audit their systems locally. (as we also saw with the July “is” compromise and the late-Aug Nx incident).
Level-Farmer6110@reddit
man i saw 198 critical sec vulnerabilities and thought i messed up pretty bad, thank God its not my fault :sob:
Advocatemack@reddit (OP)
UPDATE: We have found another package from a different maintainer that has been compromised. https://www.npmjs.com/package/proto-tinker-wc/v/0.1.87
This one isn't that big but proves that the phishing campaign has compromised multiple maintainers.
Jonno_FTW@reddit
That package has already been removed
Selentest@reddit
Selentest@reddit
To quickly check dependency tree
redditrasberry@reddit
I love it!
But also the irony: the solution to having downloaded random code from the internet is to download and run more random code from the internet :-)
Selentest@reddit
But it doesn't download anything, unless I'm missing some obvious joke here?
Foghkouteconvnhxbkgv@reddit
I'm not even sure I have this downloaded but someone told me this was happening. Is there something I should be doing to isolate this or something?
moeanimuacc@reddit
Do we not know what's the actual risk for affected devices?
Is the session, the browser, the machine or even the network fucked? The CVE says to burn the machine but as far as I can tell from articles and these threads the attack was extremely niche.
So do we know what's actually compromised? Are keys and secrets on a machine safe? Local files? .envs? Browser inputs and saved credentials? Is there a risk for a backdoor to have been set by the attacker?
Ikeeki@reddit
I feel like this happens at least once a year and especially in the Npm ecosystem.
Everything okay over there?
urbrainonnuggs@reddit
Is my favorite package 'is-odd' safe?
Steadexe@reddit
Only is-even, oh wait it depends on is-odd
redditrasberry@reddit
hmm, make sure to check is-odd-or-even as well, they both depend on that
Dazzling_Marzipan474@reddit
Just heard this and I'm definitely not a developer.
But why is 1 person in charge of so much stuff? Also how did they get phished? That's like the most basic scam. They didn't verify the email with anyone? Like wtf?
sparr@reddit
How many of those 2B downloads are without a version specified?
ImpressionUnable2304@reddit
Is there any way to recover the lost crypto?
Spare-Sock5207@reddit
`chalk` doesn't belong to \~qix, it belongs to Sindre Sorhus. I haven't checked other packages from the list that deeply.
Making _all versions_ of a dependency when in reality only several latest versions of it contain backdoor is a bit of a dick move to the whole JS community.
Overall, this particular security vulnerability report is extremely. The author of the report should calm down a little, and the maintainers of the vulnerability reporting server should revisit the range of affected versions.
Ythio@reddit
If the maintainer doesn't have recovered his account yet, as OP mentions in the comment, a new patch of an existing version could be published at any moment and people who using ~, ^, <=, <, or .x in their package.json would be fucked.
The assessment is fair at least until the maintainer can prove he secured his account
Spare-Sock5207@reddit
npm doesn't allow reuploading different code for an existing version of a package after 24 hours
Ythio@reddit
If 2.0.0 is the current version, 1.2.0 is an old version, I don't see why I can't push a 1.2.1 and if your version specified is \^1.2.0 or <1.3.0, you will get it.
Shne@reddit
I'm pretty sure that hasn't been the case for several years now. Npm will generate a
package-lock.json
file automatically, and bothnpm ci
andnpm install
will get the version to install from there overpackage.json
.Of course, if you don't commit your package-lock.json file, you could be compromised in the way you describe.
Ythio@reddit
So, should we bet that millions of people have committed a file or should we mark the whole package as unsafe until the maintainer recovers control over his account ?
bot403@reddit
If Im following security best practices by having a lockfile, and I'm not pulling bad versions, then don't lock me out of building and deploying my own app. And dont lock thousands (or perhaps also millions as you say) of other apps from deploying when they are following best practices.
Deathmeter@reddit
This has been really bugging me. It's impossible to tell what's _really_ compromised or whether I have the compromised version installed
iamapizza@reddit
If you did a fresh npm install today, and it has one of those packages listed, then you should be somewhat concerned.
If you have an existing project and you use package-lock.json and you didn't run npm audit today, you're probably OK.
swimmer385@reddit
If my runner installed these packages, would any repo secrets I have in github be compromised?
Bread_Puzzleheaded@reddit
this highlights the risk of centralized infrastructure. npm is a centralized service, relying on centralized access of a centralized developer, and billions of affected nodes dependent on that tiny centralized power tip
BugBaba_dev@reddit
phxgg made a quick script that will run
npm cache ls
on every affected package and will tell you if you pulled any vulnerable version. Only tested on MacOShttps://gist.github.com/phxgg/737198b6e945aba7046e9f9328576271
bot403@reddit
This looks like what I just vibe-coded with chatgpt to check. You can get lots of flavors of this from chatgpt for your platform. I already have and used a linux version.
BugBaba_dev@reddit
Message from NPM:
"All impacted package versions have been taken down."
Requested further information about which packages were published, their versions, and all account actions NPM took.
Whispeeeeeer@reddit
I think they were all one patch version from latest. So if the current latest is 0.2.2, then the corrupted version was 0.2.3. The article mentions the packages I believe. NPM froze out access to the maintainers account and removed the infected packages.
D-J-9595@reddit
https://xkcd.com/2347/
Dovah_Kro@reddit
First of all, thank you for making this post. It has helped tremendously for research into this issue today after seeing a wall of critical vulnerabilities.
Secondly, Looking forward to seeing an eventual Fireship video on this.
BugBaba_dev@reddit
it only ran some code to intercept wallet transactions and change the receiver
DigThatData@reddit
this is a great reminder that no matter how smart or savvy you are, no one is immune to targeted social engineering.
Pupaak@reddit
Its fixed. Run npm update
FeelingIntention7752@reddit
It looks like they patched the packages. Recently ran' npm audit', and it returned 0 vulnerabilities.
Whispeeeeeer@reddit
I used https://obf-io.deobfuscate.io/ to de-obfuscate the code and then ChatGPT to lazily try to explain the exploit in more detail. It was actually decently helpful, but could someone tell me if the exploit exposes the "hacker" wallets? Can we see if the exploit has successfully taken any money from anyone yet?
Zushii@reddit
Yes massive fail: https://etherscan.io/address/0xFc4a4858bafef54D1b1d7697bfb5c52F4c166976
kherodude@reddit
So, make a gigantic internet move only for $.44?
Living_male@reddit
That is from Ether, I'm now seeing another whopping 20.5$ in additional profit form Gondola tokens (whatever those are)!
Dry-Video5036@reddit
it only targets web-apps - if you're running this with node ur fine
Atulin@reddit
Or, in other words, Tuesday
stormdelta@reddit
If you can't be bothered to write something yourself why do you expect us to read it?
You should have just linked to the actual report and not added all this meaningless generated noise.
Jax_Doge@reddit
What a terrible security gate.
picuino@reddit
Maybe a hint: hackers used "we kindly ask you" in the phishing message. I've only seen indians use "kindly" in that way thinking it's standard use.
rlbond86@reddit
Largest NPM Compromise in History so far.
ozzy_og_kush@reddit
Upvoting for visibility.
cake-day-on-feb-29@reddit
At first I thought this was yet another fake exploit report due to this AI-generate cancer, but apparently it's real... and yet we're still using AI to generate shit about it?
wordsoup@reddit
Who would have thought… probably everyone that worked with npm for 5 minutes.
Deranged40@reddit
Largest NPM compromise in history so far.
Humble_Tension7241@reddit
Thanks for the heads up
xsubo@reddit
2 billion weekly downloads?
shevy-java@reddit
Nothing beats left-pad.