frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Ovi: Twin backbone cross-modal fusion for audio-video generation

https://github.com/character-ai/Ovi
220•montyanderson•4h ago•68 comments

Willow quantum chip demonstrates verifiable quantum advantage on hardware

https://blog.google/technology/research/quantum-echoes-willow-verifiable-quantum-advantage/
352•AbhishekParmar•8h ago•165 comments

JMAP for Calendars, Contacts and Files Now in Stalwart

https://stalw.art/blog/jmap-collaboration/
220•StalwartLabs•6h ago•94 comments

Why SSA Compilers?

https://mcyoung.xyz/2025/10/21/ssa-1/
79•transpute•3h ago•31 comments

Mass Assignment Vulnerability Exposes Max Verstappen Passport and F1 Drivers PII

https://ian.sh/fia
197•galnagli•5h ago•45 comments

Scripts I wrote that I use all the time

https://evanhahn.com/scripts-i-wrote-that-i-use-all-the-time/
405•speckx•8h ago•140 comments

Google flags Immich sites as dangerous

https://immich.app/blog/google-flags-immich-as-dangerous
49•janpio•2h ago•11 comments

Element: setHTML() method

https://developer.mozilla.org/en-US/docs/Web/API/Element/setHTML
98•todsacerdoti•14h ago•40 comments

Rivian's TM-B electric bike

https://www.theverge.com/news/804157/rivian-tm-b-electric-bike-price-specs-helmet-quad
112•hasheddan•5h ago•197 comments

YASA beats own power density record pushing electric motor to 59kW/kg benchmark

https://yasa.com/news/yasa-smashes-own-unofficial-power-density-world-record-pushing-state-of-the...
18•breve•2h ago•6 comments

Common yeast can survive Martian conditions

https://phys.org/news/2025-10-common-yeast-survive-martian-conditions.html
38•geox•1w ago•18 comments

InpharmD (YC W21) Is Hiring – NLP Engineer

https://inpharmd.com/jobs/inpharmd-is-hiring-ai-ml-engineer
1•tulasichintha•2h ago

Karpathy on DeepSeek-OCR paper: Are pixels better inputs to LLMs than text?

https://twitter.com/karpathy/status/1980397031542989305
77•JnBrymn•1d ago•14 comments

VortexNet: Neural network based on fluid dynamics

https://github.com/samim23/vortexnet
5•vegax87•58m ago•0 comments

Enchanting Imposters

https://daily.jstor.org/enchanting-imposters/
7•Petiver•17h ago•1 comments

LibCube: Find new sounds from audio synths easier

https://github.com/cslr/libcube-public/wiki
9•cslr•4d ago•2 comments

Iceland reports the presence of mosquitoes as climate warms

https://www.npr.org/2025/10/22/nx-s1-5582748/iceland-mosquitoes-first-time
47•sans_souse•1h ago•10 comments

MinIO stops distributing free Docker images

https://github.com/minio/minio/issues/21647#issuecomment-3418675115
641•LexSiga•17h ago•377 comments

Show HN: Cuq – Formal Verification of Rust GPU Kernels

https://github.com/neelsomani/cuq
30•nsomani•4h ago•22 comments

I, Sharpie

https://www.commonplace.org/p/chris-griswold-i-sharpie
12•delichon•6d ago•7 comments

Criticisms of “The Body Keeps the Score”

https://josepheverettwil.substack.com/p/the-body-keeps-the-score-is-bullshit
178•adityaathalye•5h ago•184 comments

I see a future in jj

https://steveklabnik.com/writing/i-see-a-future-in-jj/
186•steveklabnik•6h ago•110 comments

HP SitePrint

https://www.hp.com/us-en/printers/site-print/layout-robot.html
141•gjvc•6h ago•101 comments

Cryptographic Issues in Cloudflare's Circl FourQ Implementation (CVE-2025-8556)

https://www.botanica.software/blog/cryptographic-issues-in-cloudflares-circl-fourq-implementation
138•botanica_labs•9h ago•66 comments

The Tonnetz

https://thetonnetz.com/
41•mci•4d ago•7 comments

Rethinking CQRS: An Interview on OpenCQRS

https://docs.eventsourcingdb.io/blog/2025/10/23/rethinking-cqrs-an-interview-on-opencqrs/
15•goloroden•3h ago•0 comments

Vertiginous Accounts: Travels in the Air (1871 edition)

https://publicdomainreview.org/collection/travels-in-the-air/
5•prismatic•17h ago•0 comments

Galaxy XR: The first Android XR headset

https://blog.google/products/android/samsung-galaxy-xr/
148•thelastgallon•6h ago•171 comments

Linux Capabilities Revisited

https://dfir.ch/posts/linux_capabilities/
162•Harvesterify•9h ago•33 comments

Greg Newby, CEO of Project Gutenberg Literary Archive Foundation, has died

https://www.pgdp.net/wiki/In_Memoriam/gbnewby
504•ron_k•14h ago•69 comments
Open in hackernews

Element: setHTML() method

https://developer.mozilla.org/en-US/docs/Web/API/Element/setHTML
97•todsacerdoti•14h ago

Comments

michalpleban•3h ago
So is this basically a safe version of innerHTML?
Octoth0rpe•3h ago
Yes, although a slightly more relevant way of putting it would be that it's an inbuilt DOMPurify (dompurify being an npm package commonly used to sanitize html before injecting it).
evilpie•2h ago
We enabled this by default in Firefox Nightly (only) this week.
spankalee•1h ago
I'll be very excited to use this in Lit when it hits baseline.

While lit-html templates are already XSS-hardened because template strings aren't forgeable, we do have utilities like `unsafeHTML()` that let you treat untrusted strings as HTML, which are currently... unsafe.

With `Element.setHTML()` we can make a `safeHTML()` directive and let the developer specify sanitizer options too.

StrauXX•1h ago
Why don't you use DOMPurify right now? It's battle tested and supports configs just like this proposal.
ffsm8•15m ago
Why would the framework do that?

The app developers can still use that right now, but if the framework forces it's usage it'd unnecessarily increase package size for people that didn't need it.

redbell•2h ago
> This feature is not Baseline because it does not work in some of the most widely-used browsers.

This is interesting, but it appears to be in its early days as none of the major browsers seem to support it.. yet.

JadeNB•1h ago
A sibling comment by evilpie says that it is enabled in Firefox Nightly: https://news.ycombinator.com/item?id=45674985
MarsIronPI•48m ago
Actually, it exists behind an about:config as far back as 138. So if you enable it, it even works in the current ESR.
CaptainOfCoit•2h ago
Really happy to see it, after 25 years (https://www.bugcrowd.com/glossary/cross-site-scripting-xss/) of surviving without it. It always struck me as an obvious missing part of the DOM API, and I still don't know why it took this long time.

But mostly I'm just happy that it's finally here, I do appreciate all the hard work people been doing to get this live.

AlienRobot•2h ago
Great functionality, terrible name.
varun_ch•2h ago
I sometimes wonder whether what the DOM APIs could look like in a hypothetical world where we could start over with everything.
jonathrg•1h ago
Why? Does it not set the HTML?
netsharc•52m ago
It doesn't say "There's a lot of hidden sanitizing stuff inside this method" from the name...

Something like "setSafeHTML()" would be preferable. (Since it's Mozilla, there should be a few committee meetings to come up with the appropriate name)...

dzogchen•2h ago
Neat. I think once this is adopted by HTMX (or similar libraries) you don't need to sanitize on the server side anymore?
dylan604•2h ago
Do you honestly feel that we will ever be in a place for the server to not need to sanitize data from the client? Really? I don't. Any suggestion to me of "not needing to sanitize data from client" will immediately have me thinking the person doing the suggesting is not very good at their job, really new, or trying to scam me.

There's no reason to not sanitize data from the client, yet every reason to sanitize it.

jsmith99•2h ago
It's arguably easier just to sanitise at display time otherwise you have problems like double escaping.
bpt3•1h ago
Easier does not mean better, which seems to be true in this case given the many, many vulnerabilities that have been exploited over the years due to a lack of input sanitization.
padjo•1h ago
In this case easier is actually better. Sanitize a string at the point where you are going to use it. The locality makes it easy to verify that sanitation has been done correctly for the context. The alternative means you have to maintain a chain of custody for the string and ensure it is safe.
dylan604•22m ago
if you are using it at the client, sure, but then why is the server involved? if you are sending it to the server, you need to treat it like it is always coming from a hacker with very bad intentions. i don't care where the data comes from, my server will sanitize it for its own protection. after all, just because it left "clean" from your browser does not mean it was not interfered with elsewhere upstream TLS be damned. if we've double encoded something, that's fine, it won't blow up the server. at the end of that day, that's what is most important. if some double decoding doesn't happen correctly on the client, then <shrugEmoji>
strbean•2h ago
It can be a complicated and error-prone process, mainly in scenarios where you have multiple mediums that require different sanitizers. Obviously you should do it. But in such scenarios, the best practice is to sanitize as close to the place it is used as possible. I've seen terrible codebases where they tried to apply multiple layers of sanitization on user input before storing to the DB, then reverse the unneeded layers before output. Obviously this didn't work.

Point being, if you can move sanitization even closer to where it is used, and that sanitization is actually provided by the standard library of the platform in question, that's a massive win.

immibis•1h ago
By "sanitise" what's really meant is usually "escape". User typed their display name as <script>. You want the screen to say their display name, which is <script>. Therefore you send &lt;script&gt;. That's not their display name - that's just what you write in HTML to get their display name to appear on the screen. You shouldn't store it in the database in the display_name column.
strbean•1h ago
Agreed. The codebase I'm thinking of was html encoding stuff before storing it, then when they needed to e.g. send an SMS, trying to remember to decode. Terrible.
dylan604•13m ago
You're making a bad assumption that client side code was the last place the submitted string was altered in the path to the server. The man in the middle might have a different idea and should always be protected against on the server where it is the last place to sanitize it.
padjo•1h ago
Sanitize as close as possible to where it is used is usually best, then you don’t have to keep track of what’s sanitized and what’s not sanitized for very long.

(Especially important if sanitation is not idempotent!)

auxiliarymoose•33m ago
If you sanitize on the server, you are making assumptions about what is safe/unsafe for your clients. It's possible to make these assumptions correctly, but that requires keeping them in sync with all clients which is hard to do correctly.

Something that's sanitized from an HTML standpoint is not necessarily sanitized for native desktop & mobile applications, client UI frameworks, etc. For example, with Cloudflare's CloudBleed security incident, malformed img tags sent by origin servers (which weren't themselves by themselves unsafe in browsers) caused their edge servers to append garbage (including miscellaneous secure data) from heap memory to some requests that got indexed by search engines.

Sanitization is always the sole responsibility of the consumer of the content to make sure it presents any inbound data safely. Sometimes the "consumer" is colocated on the server (e.g. for server rendered HTML + no native/API users) but many times it's not.

dylan604•16m ago
> If you sanitize on the server, you are making assumptions about what is safe/unsafe for your clients.

No. I'm making decisions on what is safe for my server. I'm a back end guy, I don't really care about your front end code. I will never deem your front end code's requests as trustworthy. If the front end code cannot properly handle encoding, the back end code will do what it needs to do to not allow stupid string injection attacks. I don't know where your request has been. Just because you think it came from your code in the browser does not mean that was the last place it was altered before hitting the back end.

ishouldbework•2h ago
> It then removes any HTML entities that aren't allowed by the sanitizer configuration, and further removes any XSS-unsafe elements or attributes — whether or not they are allowed by the sanitizer configuration.

Emphasis mine. I do not understand this design choice. If I explicitly allow `script` tag, why should it be stripped?

If the method was called setXSSSafeSubsetOfHTML sure I guess, but feels weird for setHTML to have impossible-to-override filter.

evilpie•2h ago
If you want to use an XSS-unsafe Sanitizer you have to use setHTMLUnsafe.
jmull•2h ago
I guess they are going for a safe default... the idea is people who don't carefully read the docs or carefully monitor the provenance of their dynamically generated HTML will probably reach for "setHTML()".

Meanwhile, there's "setHTMLUnsafe()" and, of course, good old .innerHTML.

strbean•2h ago
This is primarily an ergonomic addition, so it kinda makes sense to me to not make the dangerous footguns more ergonomic in the process. You can still assign `innerHTML` etc. to do the dangerous thing.
hsbauauvhabzb•2h ago
Ideally this should be called dangerouslySetInnerHTML but hindsight blah blah
meowface•2h ago
I agree, though I also agree with the parent that the method name is a little bit confusing. "safeSetHTML" or "setUntrustedHTML" or something would be clearer.
strbean•1h ago
Idk about that, there's a good argument that the most obvious methods should be the safe ones. That's what juniors will probably jump to first. If you need the unsafe ones, you'll probably be able to figure that out and find them quickly.
wewtyflakes•1h ago
Wouldn't that open the floodgates by allowing code that could itself call `setHTML` again but then further revise the args to escalate its privileges?
ibowankenobi•1h ago
The API design could be better. Document fragments are designed to be reused. It should accept an optional fragment key which accepts a document fragment.If not a fragment, throw, if has children, empty contents first.
spankalee•1h ago
In what way are document fragments meant to be reused?

They empty their contents into the new parent when they're appended, so they can't be meaningfully appended a second time without rebuilding them.

`<template>` is mean to be reused, since you're meant to clone it in order to use it, and then you can clone it again.

padjo•1h ago
As someone who has dealt with more than my fair share of content injection vulnerabilities over the years this is great to see at last. It’s kinda crazy that this only coming now while other, more cumbersome solutions like CSP have been around for years.
modinfo•1h ago
Cursor build a pseudo-sethtml: https://github.com/skorotkiewicz/pseudo-sethtml
_the_inflator•1h ago
Maybe it is then time for having something that is beyond "use strict" at the beginning auf a JavaScript document as one option to use the statement.

I think a config object in which you define for script options like sanitization and other script configuration might be helpful.

After all, there almost always need to be backward compatibility be ensured, and this might work. I am no spec guy, it is just an idea. React makes use of "use client/server", so this would be more central and explicit.