News for hackers. Stuff that matters.
Re:A cautionary tale from the decline of SourceForge by ramesh31 on Thursday April 21, 2022 @12:11PM (#31111347)
>Which windows package managers build from source? I thought they were all binary package managers.

I think the GP meant downloading random binaries through a web browser, as most people do on Windows. Package managers with hash verification are a million times safer than that.

Re:A cautionary tale from the decline of SourceForge by mike_hearn on Thursday April 21, 2022 @01:43PM (#31112716)
Hash verification does nothing as SSL is protecting ordinary downloads from MITM attacks already.

Actually, binary package managers are arguably strictly less safe than getting the binaries directly from upstream because you've just introduced a (literal) "man in the middle", who might have their own agendas and their own need to monetize. Like, for example ... SourceForge did. In a different context these MITM attacks can go wrong even when they're genuinely trying to be helpful, as we may remember when Debian accidentally patched out important code from a core encryption library and caused everyone to get the same SSH keys.

Generally for security you want to reduce the number of middlemen who can tamper with things, unless those middlemen are explicitly adding some sort of security value by pre-tasting the apps. So, Apple app reviewers: yes. Linux distro maintainers: sorta sometimes. Homebrew, winget etc: no. It's all automated.

Re:A cautionary tale from the decline of SourceForge by noasaservice on Thursday April 21, 2022 @05:05PM (#31115175)
Explain to me how SSL tells me so I know which is the right site:

     https://www.vlcdownload.com
     https://www.vlcdownloads.com
     https://www.videolan.com
     https://www.vlc.com
     https://www.downloadvlc.com
     https://www.videolan.org
     https://www.videolan.co.uk
     https://sourceforge.net/projects/vlc/
In linux/Mac, I can "sudo apt install vlc", "sudo yum install vlc", or "sudo brew install vlc". I know I'm getting a valid and good software delivery. It just works. No malware. No sketchy websites. No malware packages.

On Windows, well, you feelin lucky?

Re:A cautionary tale from the decline of SourceForge by mike_hearn on Friday April 22, 2022 @06:30AM (#31120016)
That's true, but it cuts both ways.

apt-get install wine

Did you just get Wine from upstream? The answer is no and this has wasted significant amounts of time of Wine developers in the past. I used to be one and spent way too many free evenings and weekends debugging subtle crashes reported by users, that turned out to be packaging bugs introduced by men-in-the-middle.

Lots of other Wine devs had the same experience, so at that time we had a policy that if someone reported a bug the first instruction was to uninstall their distro package and to install the binary packages produced by the Wine project itself. Sometimes users were upset by this advice, but it resolved a significant number of "bugs" that were being added by the distributors.

Re:A cautionary tale from the decline of SourceForge by arinlen on Thursday April 21, 2022 @06:40PM (#31116060)
> On Windows, well, you feelin lucky?

Doesn't chocolatey fit the bill?

https://chocolatey.org/

Re:A cautionary tale from the decline of SourceForge by willismichael on Thursday April 21, 2022 @07:22PM (#31116406)
The whole point of the earlier comments is that it is preferable to use a package manager instead of using a browser to download binaries.
Re:A cautionary tale from the decline of SourceForge by arinlen on Friday April 22, 2022 @02:40AM (#31118913)
> The whole point of the earlier comments is that it is preferable to use a package manager instead of using a browser to download binaries.

But there are package managers for Windows, aren't there?

Microsoft even has its own app store, that you need to use to install applications such as Windows Terminal.

People often install software on Linux and macOS by downloading installers using a browser. In fact, that's how non-bleeding edge versions of Xcode are installed.

Re:A cautionary tale from the decline of SourceForge by TheSpiceIsLife on Thursday April 21, 2022 @07:25PM (#31116420)
On Windows I can just

   choco install vlc
Re:A cautionary tale from the decline of SourceForge by dijit on Thursday April 21, 2022 @07:43PM (#31116557)
It is preferable to read comments before replying.
Re:A cautionary tale from the decline of SourceForge by InfiniteRand on Friday April 22, 2022 @09:59AM (#31121615)
As a practical approach on Windows, for well-known software, I go to Wikipedia, look up the project there and then get the link, obviously that's not guaranteed to be correct, but for well-known projects bad links usually get corrected relatively fast, so it's probably correct

For lesser known projects I just cross my fingers, but typically lesser known projects are less likely to have malware posing as them

Re:A cautionary tale from the decline of SourceForge by yurymik on Thursday April 21, 2022 @05:57PM (#31115686)
Now we have `winget install VideoLAN.VLC` :)
Re:A cautionary tale from the decline of SourceForge by sharken on Thursday April 21, 2022 @10:18PM (#31117508)
Which is sadly not as intuitive as 'choco install vlc', WinGet really needs to support aliases to become widely used.

Chocolatey does have it's quirks though, there is both a '7zip' and a '7zip.install' package, it's not intuitive what the difference is.

Re:A cautionary tale from the decline of SourceForge by abetancort on Friday April 22, 2022 @05:45PM (#31128575)
Go to GitHub directly... forget direct links.
Re:A cautionary tale from the decline of SourceForge by saghm on Thursday April 21, 2022 @10:13PM (#31117476)
I think the idea is that a lot of the major package repositories tend to curate what's published (rather than let anyone arbitrarily publish whatever they'd like). If I trust the maintainers of the Debian or Fedora or Arch repos or whatever, then the fact that they serve a package means I would trust it more than downloading from some random website I don't know.
Re:A cautionary tale from the decline of SourceForge by robonerd on Thursday April 21, 2022 @12:22PM (#31111486)
Checking a hash is safer only if the person who commits the "known good hash" to the package repository actually verifies that goodness. If the programs developer sells out and puts malware into their official binary releases, and the package maintainer doesn't notice this, then checking hashes doesn't protect you from the malicious release.
Re:A cautionary tale from the decline of SourceForge by ramesh31 on Thursday April 21, 2022 @12:33PM (#31111643)
>If the programs developer sells out and puts malware into their official binary releases, and the package maintainer doesn't notice this, then checking hashes doesn't protect you from the malicious release.

Nothing short of a full code review will save you from a malicious supply chain attack. This is currently exploding with NPM as well, so building from source doesn't save you here either. See the node-ipc debacle from a few weeks ago [0], and also my own post from last week about a malware infected NPM module [1].

The reality is that yes, the days of being able to trust anything downloaded from a stranger on the internet are pretty much over now. But known-hash package management is still a good first layer of security versus downloading random binaries from the web.

[0] https://nvd.nist.gov/vuln/detail/CVE-2022-23812

[1] https://news.ycombinator.com/item?id=30963600

Re:A cautionary tale from the decline of SourceForge by ryukafalz on Thursday April 21, 2022 @03:07PM (#31113899)
> Nothing short of a full code review will save you from a malicious supply chain attack.

Nonsense. Or, at least, an oversimplication.

https://medium.com/agoric/pola-would-have-prevented-the-even...

Nothing short of full code review will ensure that malicious code from a dependency doesn’t get into your program at all, but the capabilities of that malicious code once it does get into your program can certainly be limited.

Re:A cautionary tale from the decline of SourceForge by munk-a on Thursday April 21, 2022 @04:31PM (#31114785)
I don't disagree that Javascript in general runs with a lot more permissions than should probably be given but permissions is a very hard thing to manage. So you decide to install a node package that helps retry and automatically back off requests you want to send to your server since you're working in a mobile environment that has sketchy internet reliability... it is very hard to craft a set of permissions to allow that package to retry requests to certain addresses you'd like to retry without also letting it throw random system metrics it's collecting to an ad-server. Additionally, these permissions will be more comprehensible to review but they still need to be reviewed and reviewed by a party you trust.

That's a tall order for the open source community when it comes to a volume of packages like npm or composer.

You can logically look at lpad as a package and say "We're padding strings, we don't need to do anything with network traffic or disk reads" but building an automated system to make that evaluation and saving that evaluation in a tamperproof manner is going to be hard... and what happens if lpad starts trying to do a better job - operating correctly in left-to-right character sets and in languages where alignment is dictated by hyphens instead of blank space.

Code isn't simple and while the above statement may seem hyperbolic I think it's just because most of us accept the risk, it's highly unlikely that malicious supply chain attacks will suddenly sink our businesses so we accept a reasonable level of security in exchange for what feels like a modest risk but actually fully 100% preventing that risk? You'll need to check every usage scenario on every set of hardware and go through that code with a fine toothed comb.

Re:A cautionary tale from the decline of SourceForge by ryukafalz on Thursday April 21, 2022 @05:38PM (#31115503)
> it is very hard to craft a set of permissions to allow that package to retry requests to certain addresses you'd like to retry without also letting it throw random system metrics it's collecting to an ad-server

If you're expecting to have to craft ACLs program-wide for that package, then sure, that's going to be hard. That's more coarse-grained than what I'm talking about here though.

Imagine, if you will, a programming environment where modules you load don't have any authority to access the network, filesystem, etc unless you pass them in. They're just not in scope. In such a language, the default way to grant HTTP access might look like this in pseudo-Python:

  http = require("http")
  myMaliciousLibrary = require("myMaliciousLibrary", http=http)
Now, this library has the problem you mentioned; it can make arbitrary outgoing HTTP requests, meaning it can send any metrics it collects to an ad server. It can't access the filesystem because the filesystem isn't in scope either, so what it can collect is limited, but still more access than it needs. So here's one way you might fix that (obviously highly simplified/incomplete in its implementation):

  class ProxyHTTP(origin="https://example.com", http):
      def __init__(origin="https://example.com"):
          self.allowed_origin = origin
  
      def get(origin, path="/"):
          return http.get(self.allowed_origin, path)
  
  http = require("http")
  myMaliciousLibrary = require("myMaliciousLibrary", http=ProxyHTTP(origin="https://good-site.example.com", http))
Now, this version of myMaliciousLibrary gets an object that looks like the http library it would normally use; it just happens to ignore the origin parameter that the library passes to it and uses the one it was initialized with instead. Now, that library can make requests to good-site.example.com, but if it tries to make a request to adserver.evil.com, it'll go to good-site.example.com instead. (You might also imagine a version of ProxyHTTP that just throws an error if the request's origin isn't the same one it was initialized with, or isn't in a list it was initialized with.)

Most of today's programming languages aren't strict enough to enable this of course; JavaScript isn't there yet for example, and most other languages aren't even close to being able to do this. But that's mostly because they don't provide strict enough encapsulation, not because they're lacking some complex security enforcement mechanism.

> I think it's just because most of us accept the risk, it's highly unlikely that malicious supply chain attacks will suddenly sink our businesses so we accept a reasonable level of security in exchange for what feels like a modest risk

I just think people are accepting way more risk than they realize, given the number of dependencies in modern applications and the amount of access each of those dependencies have. It feels crazy that any one of those dependencies in any application could exfiltrate massive amounts of sensitive data from any machine it happens to run on.

Re:A cautionary tale from the decline of SourceForge by munk-a on Thursday April 21, 2022 @06:29PM (#31115962)
I think there'd be a lot of reliance on all these fundamental components working correctly (and prohibiting other components i.e. "We're using this curl library at a basic level and exposing a safe interface through this protected library but somehow blocking calls from code outside the library") which might have serious repercussions for code reuse.

There are ways you can instruct an OS to block calls to certain library functions/memory ranges (i.e. remove and grant elevations privileges) but I think such a system would need to be designed from the ground up. If you can still `require(lib/reallyOldCurl)` then your protections might allow linters to be able to mark packages as unsafe, but I think it'd be extremely difficult to block access without an extremely fundamental design intent.

I appreciate your reply quite a bit though as I was envisioning the restrictions being defined on a universal package level (aka lpad is given no disk access) rather than being delegated to the consuming developer.

Re:A cautionary tale from the decline of SourceForge by bbarnett on Thursday April 21, 2022 @12:40PM (#31111741)
I appreciate what you are saying, but it was over decades ago!

Node is just insane, always was, along with the curl | bash crowd.

Madness.

Re:A cautionary tale from the decline of SourceForge by hassancf on Friday April 22, 2022 @05:28AM (#31119707)
Isn’t the following better than current windows package managers?

a) Download file.EXE binary from somewhere

b) run: certutil -hashfile file.EXE (which spits out hash value)

c) search for hash value obtained at step “b” on a site like: virustotal.com : it tells you if malware is detected

d) run: file.exe (if no malware detected)

I honestly couldn’t find a better method on MS Windows. Other suggestions?

Re:A cautionary tale from the decline of SourceForge by abetancort on Friday April 22, 2022 @05:46PM (#31128601)
Go to Github directly and find the VLC repository from there everything is straightforward. Forget Sourgeforge, it jumped the shark years ago.