News for hackers. Stuff that matters.
Re:Reddit's website uses DRM for fingerprinting by userbinator on Wednesday July 08, 2020 @07:31PM (#23775424)
i.e. the main redesign domain, not old.reddit.com

If the old one didn't do this, there's yet another reason to use it...

I still believe that part of the reason a lot of sites are moving to JS-only SPAs and the like is that it becomes much harder to block things like this. Regardless of sandboxing, the idea of letting a site execute Turing-complete computations on its visitor's computers, just to display what could be done without, is quite repulsive.

Re:Reddit's website uses DRM for fingerprinting by kiwidrew on Wednesday July 08, 2020 @08:16PM (#23775720)
> the idea of letting a site execute Turing-complete computations

I'll admit that I have never been keen on the "browse with Javascript disabled" idea, but after my digging around yesterday to figure out why Reddit kept asking me to enable DRM [which I totally should've blogged about but oh well....] it shocked me to see just how much JS code was being loaded on each pageview.

Now I'm seriously considering taking the NoScript plunge.

The problem is that a light sprinkling of Javascript really can go a long way towards making HTML more usable -- how can we find a way to permit the "good" uses of Javascript while prohibiting all of the "bad"?

Re:Reddit's website uses DRM for fingerprinting by userbinator on Wednesday July 08, 2020 @08:55PM (#23775952)
how can we find a way to permit the "good" uses of Javascript while prohibiting all of the "bad"?

By imposing resource limits? I know browsers already have time limits on script execution, but perhaps a memory limit would help too. A "light sprinkling of Javascript" would probably need KBs or a few MB at most to do what it needs to. The problem is that none of the mainstream browsers nor web developers (and especially not Google's) will want to do that --- compare new vs (unfortunately, quickly disappearing) old YouTube, for example; the latter is a mostly-static site with JS enhancements, and the former is basically a SPA. Despite the reduction in functionality of the former, the most common complaints are about how slow it is, and it uses a huge amount of RAM too.

Re:Reddit's website uses DRM for fingerprinting by echelon on Wednesday July 08, 2020 @10:28PM (#23776406)
Make websites pay to run remote instructions on users' computers. It'd never happen, but it's a fun concept.
Re:Reddit's website uses DRM for fingerprinting by tannhaeuser on Thursday July 09, 2020 @03:13AM (#23777733)
> how can we find a way to permit the "good" uses of Javascript while prohibiting all of the "bad"?

I always thought HTML could've been gradually extended with new elements for capturing and replacing UI techniques which Javascript is essential for, but that hasn't happened. Instead, HTML is stuck with what was envisioned in 2008 or earlier (coming from a hierarchical document structure for casual academic publishing), and everything else in the browser (CSS, Javascript) evolved to work around it. Today, we have CSS with it's absurd ninja powers to completely change and reinterpret the HTML DOM with a secondary document structure in the name of "semantic" HTML, locked to a 1990's idea of how a generic document should look like. It seems the evolution of HTML as a markup language suffered from being organizationally fossilized, after W3C ventured into an unrealistic XHTML2 moonshot, thus giving HTML language extensions a bad name, and the proponents of CSS believing their own "separation of concerns" story after the fact when it just started out as a hack to overcome HTML's limitations (it being in the hands of W3C and W3C focussing on a ten-year roll to replace HTML with XHTML and other XML vocabularies). HTML/SGML always had all the power you could want to define new vocabulary, even ways to define new elements in terms of fragments/combinations of existing ones for vocabulary evolution.

To be fair, though, during most of the web's existence, a visual language had to evolve as there simply was no blueprint available for how we'd use hypertext on a massive scale, especially with mobile devices. Unfortunately, the mechanisms HTML5 today has for vocabulary evolution (ie. custom elements and maybe template elements and web components) all require tons of Javascript as well.

FWIW, there's GNU's LibreJS initiative to block all but F/OSS or "trivial" JavaScript, but I don't believe it has had any impact (and it focuses solely on the licensing aspect).

Re:Reddit's website uses DRM for fingerprinting by spankalee on Thursday July 09, 2020 @01:45PM (#23782869)
One way web components can evolve to help this is with declarative custom elements, a feature many of the people who've worked on web components have wanted to pursue.

The idea is that you could define a custom element, with style and DOM encapsulation, purely in markup with either no script at all, or script only for progressive enhancement.

There are still a few features that need to be finalized and proposed, like Template Instantiation [1] to allow for expressions in HTML. When put together it would look something like this:

    <custom-element name="x-summary" attributes="href">
      <template>
        <style>
          ::slotted(h1) { color: blue; }
        </style>
        <article>
          <a href="{{ href }}"><slot name="title"</a>
          <slot></slot>
        </article>
      </template>
    </custom-element>
Which you can then use like:

    <x-summary href="http://...">
      <h1 slot="title">Hello</h1>
      <p>This article is about...</p>
    </x-summary>
Combine this with HTML modules[2] so you can import these definitions and you could build reusable widgets without script, and some UAs could evolve their script settings to allow HTML modules but not JavaScript modules for a more locked down experience.

From there I'd hope we could find a way to use worklets to allow components to use script, but limit them to only the component's shadow DOM, not the global DOM, and not have default access to APIs like XHR and fetch, or other APIs used for fingerprinting.

[1]: https://github.com/w3c/webcomponents/blob/gh-pages/proposals... [2]: https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/maste...

Re:Reddit's website uses DRM for fingerprinting by Deimorz on Wednesday July 08, 2020 @08:58PM (#23775969)
I'd recommend uMatrix over NoScript. I used NoScript for years but switched over to uMatrix a few years ago (at the time it was working in Firefox Quantum but NoScript didn't yet), and I like it better now.

It's quite a bit easier to see what's going on, toggle scripts and other assets from multiple sources, and you can change the defaults to do things like allow first-party scripts by default if you don't want to go all the way to full blocking.

It takes a while to get used to using a script-blocker like it, but it's pretty straightforward most of the time, and once you get your most commonly-used sites set up you don't need to mess around with it very often.

Re:Reddit's website uses DRM for fingerprinting by Polylactic_acid on Wednesday July 08, 2020 @09:59PM (#23776267)
I had an issue where every time I restarted firefox it would lose my umatrix data.
Re:Reddit's website uses DRM for fingerprinting by RealStickman_ on Thursday July 09, 2020 @06:07PM (#23785811)
Sorry to ask, but you clicked the padlock, right?
Re:Reddit's website uses DRM for fingerprinting by Polylactic_acid on Thursday July 09, 2020 @07:26PM (#23786451)
Nope. Is that how you save?
Re:Reddit's website uses DRM for fingerprinting by RealStickman_ on Friday July 10, 2020 @03:53AM (#23789189)
Yes. Otherwise everything will be lost when you close the browser.
Re:Reddit's website uses DRM for fingerprinting by xaqfox on Friday July 10, 2020 @11:03AM (#23792179)
There is also a cloud backup feature in the options if you are into that sort of thing.
Re:Reddit's website uses DRM for fingerprinting by m463 on Thursday July 09, 2020 @01:12AM (#23777129)
You might want to try umatrix. there's a slight learning curve.

I set the defaults to load only the main site, and load no javascript. Then per-site I turn things on until it's workable.

basically start with:

  * * * block
  * * frame block
  * * script block
  * 1st-party * allow
  * 1st-party frame allow
then enable stuff for good sites.

that + reader mode makes even horrendous sites pleasant.

Re:Reddit's website uses DRM for fingerprinting by ciarannolan on Wednesday July 08, 2020 @08:26PM (#23775771)
I browse with js off by default using the setting in uBlock Origin. It works great.

When you encounter a site (usually news sites) where the article looks wonky, just use Firefox's "reader view" which pulls out the text and puts it into a nicely formatted, clean tab.

Re:Reddit's website uses DRM for fingerprinting by dwd on Wednesday July 08, 2020 @08:50PM (#23775920)
Until they work out how to properly disable reader view because it allows you to avoid JavaScript driven paywalls and Incognito/Private Mode nags.
Re:Reddit's website uses DRM for fingerprinting by ciarannolan on Wednesday July 08, 2020 @10:01PM (#23776283)
Good point. I think some sites have already figured this out. I'll find one every now and then that clearly has a giant chunk of text in the center, but the reader view option doesn't activate.

Wonder if there's a flag that disables it or something.

Re:Reddit's website uses DRM for fingerprinting by dwd on Thursday July 09, 2020 @01:38AM (#23777239)
It might be as simple as not adding any semantic markup (an article element for example) for Reader View to use, but you could do all sorts of things with element positioning or pseudo elements to mess it up for non-humans.
Re:Reddit's website uses DRM for fingerprinting by ciarannolan on Thursday July 09, 2020 @11:59AM (#23781630)
Apparently it's a pretty complicated, holistic system of pulling just the main text.

FF uses this for its reader view: https://github.com/mozilla/readability

Re:Reddit's website uses DRM for fingerprinting by nothal on Wednesday July 08, 2020 @10:58PM (#23776538)
I find that Pocket frequently works to get around paywalls. I use it primarily for this purpose.
Re:Reddit's website uses DRM for fingerprinting by zamubafoo on Wednesday July 08, 2020 @10:08PM (#23776312)
Something that's surprised me is that there hasn't been a push to allow users to restrict a websites access to JS APIs.

If I can restrict certain sites to different browser APIs, it would make it so much easier to get rid of annoying browsing behaviour. For example, there is no good reason to allow websites to sniff my clipboard or to play multimedia without my consent.

Re:Reddit's website uses DRM for fingerprinting by zerocrates on Thursday July 09, 2020 @04:09AM (#23778003)
I think there is a move toward that, certainly for newer features as of several years ago (though they present their own issues to work out, see the deluge of permissions prompts for notifications).

Clipboard stuff is permission gated on some browsers at least already, I think. Autoplay disabling is an option for most (all?), though that's a little different.

The issue with introducing a permission system to an older feature is always a balancing act between increasing user control and potentially breaking older content.

Re:Reddit's website uses DRM for fingerprinting by metalliqaz on Wednesday July 08, 2020 @10:22PM (#23776384)
God, what a good idea. Why doesn't Chrome do this the way Android does?
Re:Reddit's website uses DRM for fingerprinting by zucker42 on Wednesday July 08, 2020 @10:04PM (#23776297)
LibreJS may be an option, but I've never used it myself.
Re:Reddit's website uses DRM for fingerprinting by zamadatix on Wednesday July 08, 2020 @08:36PM (#23775826)
Even HTML without CSS can leak more things than one might want with things like pings and lazy loading, adding in CSS it's Turing complete again (albeit much clunkier).

The reason the web could and can never end up being a read only protocol is people like the little features that make it exactly not that. People like that a page can not load images until they are needed, people like that their food delivery status can update without constantly reloading the page, people like the "cool" page that has some wizz bang interactive graphic, people like interactive content with the stream, people like live web chat like discord or twitch. Plenty of people don't have any interest in those things, they just want a book with the occasional image, but that's not what the majority get pulled in by on the web.

And once you have those things someone will always take advantage of it. If they didn't have these things they would take advantage of whatever they could. Even now there are tracking pixels and a bunch of other things that have nothing to do with JS being in the browser.

The solution isn't to try to say a page shouldn't be able to do "complicated" (for lack of a better term) things. Most people don't find a page running code repulsive. Maybe ads, bad actors, tracking. Even then a surprising number of people don't mind. But the problem wasn't that the browser has Turing complete interfaces.

What is the solution for these bad actors and use cases? Don't know. I don't think anyone knows. What I do know is if all people want are books with pictures the web isn't the medium to try to find that content in and hasn't ever really been intended as such (i.e. it's not a new development it's just easier to make and/or abuse dynamic content now).

Re:Reddit's website uses DRM for fingerprinting by tenuousemphasis on Wednesday July 08, 2020 @08:43PM (#23775869)
>What is the solution for these bad actors and use cases?

A model of paying for resources not based on serving ads and selling data? If you're not paying for a service, you are the product, not the customer.

Re:Reddit's website uses DRM for fingerprinting by zamadatix on Wednesday July 08, 2020 @09:47PM (#23776204)
The models exist they just aren't as profitable as models where you pay for a service and they still gather data. You can pay for Reddit, and YouTube, Twitch (3 personal examples) but that doesn't mean they stop tracking the same kind of usage info or trying to suggest more content to you (additional cost or just trying to hook you on the platform more) like service upsells or side markets they are getting into (YouTube TV, YouTube Gaming, YouTube premium which I think includes YouTube Music now).

The problem isn't the inability to create or fund products where the problems don't exist it's making them more attractive and financially successful than ones that don't (regardless of platform).

Re:Reddit's website uses DRM for fingerprinting by zerocrates on Thursday July 09, 2020 @04:13AM (#23778035)
You're a product either way.

Plenty of services you pay for cheerfully sell your data to pad the margins a bit more. As a verified person with the ability and inclination to pay for something, you're even a more valuable product.

Re:Reddit's website uses DRM for fingerprinting by est31 on Wednesday July 08, 2020 @07:44PM (#23775512)
And that's not the only way the redesign is infringing upon user's privacy. See also: http://archive.is/FGLEF
Re:Reddit's website uses DRM for fingerprinting by seph-reed on Wednesday July 08, 2020 @08:13PM (#23775706)
I used to really feel the same, and tried to make no-js sites for a bit.

Long story short, eventually you're going to want some user interaction beyond submitting forms, and if you've built your site as anything other than a js SPA, it's quickly going to become ugly.

Re:Reddit's website uses DRM for fingerprinting by kiwidrew on Wednesday July 08, 2020 @08:22PM (#23775754)
I wonder, would it be possible to identify a subset of Javascript that is benign? Perhaps some rules about which functions the script is permitted to use, along with restrictions on looping constructs (iterate through an array = OK; unbounded recursion = not OK)...

That way simple stuff like:

  var form = document.forms[0];
  document.getElementById('foo').addEventListener('change',
    function (e) {
      if (e.target.value == 'xyzzy')
        form.elements['bar'].classList.add('show');
    }
  );
would be perfectly fine, but crazy "let's exploit the JIT" or "emulate an entire 8-bit home computer" stuff would be rejected.

And then, as a bonus, we could dump the entire JIT infrastructure and go back to a simple JS interpreter (a la Duktape) because there just wouldn't be much code left to interpret in the first place.

Re:Reddit's website uses DRM for fingerprinting by bigiain on Wednesday July 08, 2020 @08:38PM (#23775839)
> (iterate through an array = OK; unbounded recursion = not OK)...

Right, so all we need to do is solve the halting problem... <smirk>

Re:Reddit's website uses DRM for fingerprinting by kiwidrew on Thursday July 09, 2020 @01:26AM (#23777189)
Yeah, so some syntactic rules (using Array.forEach() instead of for(;;) loops) and prohibiting some of Javascript's more dynamic features might be enough to render the language non-Turing complete. It would also -- and this is kind of the point -- render the language unable to perform certain computations that plain vanilla Javascript can perform.
Re:Reddit's website uses DRM for fingerprinting by userbinator on Wednesday July 08, 2020 @09:34PM (#23776153)
The halting problem is about the general case, but when deciding a sane subset of JS, one can always be more conservative.
Re:Reddit's website uses DRM for fingerprinting by saagarjha on Wednesday July 08, 2020 @10:40PM (#23776456)
Yeah, if your subset of JavaScript is not Turing complete.
Re:Reddit's website uses DRM for fingerprinting by anonms-coward on Wednesday July 08, 2020 @09:33PM (#23776148)
If you can prove whether recursion or even a loop is bounded or not, you have solved the collatz conjecture.
Re:Reddit's website uses DRM for fingerprinting by skeletonjelly on Thursday July 09, 2020 @01:48AM (#23777291)
reddit also packs in analytics into the voting XHR endpoint

I believe they used to use a separate domain or endpoint but being a more tech savvy audience this was blocked by a lot of people.

Load a page in old.reddit.com and you'll see a "vote" pop up in the network requests

https://www.reddit.com/api/vote

Re:Reddit's website uses DRM for fingerprinting by ryanlol on Wednesday July 08, 2020 @07:40PM (#23775484)
>the idea of letting a site execute Turing-complete computations on its visitor's computers

Why is Turing-completeness the issue here?

Re:Reddit's website uses DRM for fingerprinting by jdm2212 on Wednesday July 08, 2020 @07:43PM (#23775505)
I think that's being used to mean "it's impossible to predict/reason about/constrain what the computation might do". Turing completeness => it can do anything, you can't predict anything
Re:Reddit's website uses DRM for fingerprinting by Gene_Parmesan on Thursday July 09, 2020 @03:11AM (#23777729)
Maybe, but I think it's an overblown term in these sort of questions. Being Turing-complete doesn't mean that it can do anything. It means that it is isomorphic to a Turing machine; in other words, it can emulate a Turing machine, which means it can compute anything a Turing machine can compute.

That's definitely not the same as "do anything." For instance, it doesn't mean it's suddenly granted access to APIs to communicate with the system/break out of a sandbox. I mean, I guess it's theoretically possible for it to create an entire simulated CPU (is it though? not sure...), but not in practice.

The more concerning thing is how strong your sandbox is.

Re:Reddit's website uses DRM for fingerprinting by smitop on Thursday July 09, 2020 @08:12AM (#23779312)
> it's theoretically possible for it to create an entire simulated CPU

A Javascript x86 implementation already exists: https://copy.sh/v86/

Re:Reddit's website uses DRM for fingerprinting by ryanlol on Thursday July 09, 2020 @03:08AM (#23777716)
This only makes sense as far as resource usage goes, Turing completeness has nothing to do with access to APIs which you really need to do anything interesting.

Brainfuck is turing complete but can’t call any APIs, you can very much predict that a Brainfuck program won’t be doing anything very exciting.

Re:Reddit's website uses DRM for fingerprinting by krastanov on Wednesday July 08, 2020 @08:41PM (#23775858)
If it is not Turing complete, your sandbox/interpreter/whatever can be certain that the code does not do anything "surprising". Basically, you can know at compile time that the program fulfills certain constraints. For practical examples, see the newish virtual machine inside of the linux kernel used to execute constraint "scripts" to control the firewall (https://lwn.net/Articles/740157/)

Proving the same constraints and having the same trust in a Turing complete language is basically the halting problem, which is not computable.