is WILDBy default, when someone uses command-line tools built into Go to download or install packages
Even if you took the time to scan through the source of the module, you would need to understand all the code you’re looking at well enough to know if it was legitimate or not.I think software development has a fundamental problem caused by its need for trust. As much as researchers admonish people to audit their dependencies by reading through its code, that's a cost in time and effort that's difficult at best to justify to one's managers. Strictly speaking, they're right, assuming the backdoors are obvious enough to be spotted by someone unfamiliar with the codebase, and that they're present in the source (to my understanding Go has no library binaries, so that's not a problem here) which isn't the case for everything as we saw with the xz backdoor.
In this case in particular, it'd be difficult to detect even if one did read through the code - if I were auditing something, I'd clone its repository and read its tagged version, not open the version Go had squirreled away locally somewhere. This is an amazingly well thought out attack enabled by this caching layer - I didn't even know the caching layer existed.
is WILD
What could a package manager even do to mitigate this? Periodically compare the contents of the original source code repository to the contents of the package that they're storing? That's a BIG job. There are many tens (hundreds?) of thousands of packages served by the popular package managers, each with dozens or even hundreds of versions.
I think that within the next decade SBOMs will become mandatory for governments and large companies. And I'm not talking about what they write themselves - I'm talking about what they buy or use.
It will probably come in as an optional requirement at first - if you provide an SBOM whilst bidding, it's an extra tick when being evaluated. After a while it will become mandatory.
And it won't be a one-off thing - you'll have to provide an updated one every year. Large customers will want to know that you're actively maintaining and reviewing your SBOM. Security teams will be querying their SBOM databases when they learn about vulnerabilities, and following up with their suppliers.
Most importantly, working like this would probably mean a few customers saying "Are you sure this is right?", and typo-squatting attacks would then be spotted faster.
There may be a little resistance, but it's not really something that can be stopped. There's going to be a tipping point where it becomes "de rigeuer" for CTOs to be talking about their supply chain and how they manage it via SBOMs. There will be money to be made off the back of that, which will create a virtuous cycle that normalises it.
You should never make a prediction that can't be tested. If I'm right, within the next fifteen years there will be the first lawsuit based on a falsified SBOM that left a company or organisation open to attack. That's my test. Let's see how it goes...
Double the (bullet) points, double the miles.FYI: the "sequence of events" section is repeated twice in the article, specifically the bulleted content.
If this is a "fundamental problem" I'm afraid it affects almost all of society. It's not so much a problem as an oft-ignored constraint.I think software development has a fundamental problem caused by its need for trust.
It will always be there as long as short term stock price gains are what drives investors rather than long term dividends. Which is how things were until 40-50 years ago...stocks that didn't return dividends were usually considered worthless.If this is a "fundamental problem" I'm afraid it affects almost all of society. It's not so much a problem as an oft-ignored constraint.
Easier said than done in this case—the authentic module was no longer maintained (it was archived), so this apparently looked like a legitimate fork/continuationThis could be mitigated by not using the typosquatted version in the first place and by using the commit hash instead of the tag, which is best practice anyway to prevent supply chain attacks.
Yup, this kind of attack can take root in almost any supply chain. I would be very surprised if there weren't things like this lingering in almost any popular languages package management.AFAIK this is how most/all package managers work, whether they serve bundled source code, compiled binaries, or a combo (like a Python wheel).
What could a package manager even do to mitigate this? Periodically compare the contents of the original source code repository to the contents of the package that they're storing? That's a BIG job. There are many tens (hundreds?) of thousands of packages served by the popular package managers, each with dozens or even hundreds of versions.
Maybe GitHub could help by letting a package manager like PyPi provide lists of repos and tags, and then GitHub could let the manager know whenever one of those tags is changed? Then the manager could invalidate the bundles that they've cached and inform the authors. But that's assuming that a package has a corresponding repo, and that they're doing something like tagging each of their versions, which certainly not always the case.
What a mess.
Not Doublemint Gum?Double the (bullet) points, double the miles.
It's actually a subliminal advert for a certain credit card.
While reading the article, I was thinking to myself "This is quite clever of the people who did it, and I seriously doubt this is the first or last time they've done something like it, and I'll be reading about them again later." Comments above have reinforced that feeling.Yup, this kind of attack can take root in almost any supply chain. I would be very surprised if there weren't things like this lingering in almost any popular languages package management.
LOL.Cache invalidation is one of the two hard problems in computer science*. Part of this process is observing traffic that involves the source address. Software mirrors assume the source is invariant until it goes missing, but even outside of malicious behavior this isn't true.
*: The others being naming things and off-by-one errors.
The same need for caution applies to running on developer devices as well, with its own exciting set of distinct hazards.The research tells a cautionary tale of the importance of properly vetting code before running it on production devices
It was cached. ;-)FYI: the "sequence of events" section is repeated twice in the article, specifically the bulleted content.
What would a hash do the mitigate this? A hash of a malicious library just tells you that you got the malicious library you asked for.Why doesn't Go provide a hash for its packages like most linux distributions do these days?
e: ^^^ beaten by seconds, lol. It sounds like there is a hash but it is optional and not ergonomic to use.
It's like the gap between a company's financial report and conducting forensic accounting. Someone would need both access and the specialized domain knowledge to make sense of it all to find evidence of deliberate wrongdoing.Even if you took the time to scan through the source of the module, you would need to understand all the code you’re looking at well enough to know if it was legitimate or not.
That might be straight forward (if time consuming) for convenience packages that include code you might write yourself if you had to. But for lower level packages outside of your domain expertise? Good luck.
And that’s before you consider obfuscation. I doubt we can rely on the malware devs to document their code for us so it’s easy to spot the malicious CreateBackdoor() method…
It seems like repos need to take typosquatting a lot more seriously but this doesn't seem easy to automate over hundreds of thousands of package names.
Adding a domain, user, company prefix to a package name sounds good, but then the attackers just typosquat that too.
It is already becoming a thing in automotive, at least the embedded software. Full SBOM from suppliers, and the supplier is responsible to monitor and notify the OEM of vulnerabilities.I think that within the next decade SBOMs will become mandatory for governments and large companies. And I'm not talking about what they write themselves - I'm talking about what they buy or use.
It will probably come in as an optional requirement at first - if you provide an SBOM whilst bidding, it's an extra tick when being evaluated. After a while it will become mandatory.
And it won't be a one-off thing - you'll have to provide an updated one every year. Large customers will want to know that you're actively maintaining and reviewing your SBOM. Security teams will be querying their SBOM databases when they learn about vulnerabilities, and following up with their suppliers.
Most importantly, working like this would probably mean a few customers saying "Are you sure this is right?", and typo-squatting attacks would then be spotted faster.
There may be a little resistance, but it's not really something that can be stopped. There's going to be a tipping point where it becomes "de rigeuer" for CTOs to be talking about their supply chain and how they manage it via SBOMs. There will be money to be made off the back of that, which will create a virtuous cycle that normalises it.
You should never make a prediction that can't be tested. If I'm right, within the next fifteen years there will be the first lawsuit based on a falsified SBOM that left a company or organisation open to attack. That's my test. Let's see how it goes...
I was vaguely aware it's becoming a thing in some specialist circles, but I was thinking more military than automotive.It is already becoming a thing in automotive, at least the embedded software. Full SBOM from suppliers, and the supplier is responsible to monitor and notify the OEM of vulnerabilities.
And yes, it is very expensive as one would expect. Both to monitor, develop and patch
There is literally a classic CS paper about trust being a key component of a software system. It’s a Turing Award lecture no less!If this is a "fundamental problem" I'm afraid it affects almost all of society. It's not so much a problem as an oft-ignored constraint.
Behold, the Go programming language![...] there is [an X] but it is optional and not ergonomic to use.