City In A Bottle – A 256 Byte Raycasting System
https://frankforce.com/city-in-a-bottle-a-256-byte-raycasting-system/ [frankforce.com]
2024-05-21 06:49
tags:
graphics
javascript
programming
web
A tiny raycasting engine and city generator that fits in a standalone 256 byte html file. In this post I will share all the secrets about how this magical program works.
source: HN
The V8 Sandbox
https://v8.dev/blog/sandbox [v8.dev]
2024-04-04 23:37
tags:
browser
javascript
jit
programming
security
After almost three years since the initial design document and hundreds of CLs in the meantime, the V8 Sandbox — a lightweight, in-process sandbox for V8 — has now progressed to the point where it is no longer considered an experimental security feature. Starting today, the V8 Sandbox is included in Chrome’s Vulnerability Reward Program (VRP). While there are still a number of issues to resolve before it becomes a strong security boundary, the VRP inclusion is an important step in that direction. Chrome 123 could therefore be considered to be a sort of “beta” release for the sandbox. This blog post uses this opportunity to discuss the motivation behind the sandbox, show how it prevents memory corruption in V8 from spreading within the host process, and ultimately explain why it is a necessary step towards memory safety.
source: HN
Getting RCE in Chrome with incomplete object initialization in the Maglev compiler
https://github.blog/2023-10-17-getting-rce-in-chrome-with-incomplete-object-initialization-in-the-maglev-compiler/ [github.blog]
2023-10-18 19:08
tags:
browser
exploit
javascript
jit
security
In this post I’ll exploit CVE-2023-4069, a type confusion vulnerability that I reported in July 2023. The vulnerability—which allows remote code execution (RCE) in the renderer sandbox of Chrome by a single visit to a malicious site—is found in v8, the Javascript engine of Chrome. It was filed as bug 1465326 and subsequently fixed in version 115.0.5790.170/.171.
Getting RCE in Chrome with incorrect side effect in the JIT compiler
https://github.blog/2023-09-26-getting-rce-in-chrome-with-incorrect-side-effect-in-the-jit-compiler/ [github.blog]
2023-09-29 00:06
tags:
browser
exploit
javascript
jit
programming
security
In this post, I’ll exploit CVE-2023-3420, a type confusion in Chrome that allows remote code execution (RCE) in the renderer sandbox of Chrome by a single visit to a malicious site.
source: R
When LIMIT 9 works but LIMIT 10 hangs
https://neon.tech/blog/when-limit-9-works-but-limit-10-hangs [neon.tech]
2023-05-31 18:06
tags:
bugfix
javascript
malloc
programming
So then bytes 3 and 4 should be that 16-bit payload length — and this is where things fall apart. The ws message says we have 126 bytes (00000000 01111110) of payload. That sounds plausible. The undici message says we have 25,888 bytes (01100101 00100000) of payload … in a 222 byte packet? Yeah: this one is fishy.
source: HN
It's always been you, Canvas2D
https://developer.chrome.com/blog/canvas2d/ [developer.chrome.com]
2022-03-05 00:27
tags:
browser
graphics
javascript
update
web
Admittedly, the API is a bit behind the times when it comes to state-of-the-art 2D drawing. Fortunately we’ve been hard at work implementing new features in Canvas2D to catch up to CSS, streamline ergonomics and improve performance.
source: HN
Google Docs in a clean-room browser
https://www.ekioh.com/devblog/google-docs-in-a-clean-room-browser/ [www.ekioh.com]
2021-09-20 17:32
tags:
browser
cloud
development
javascript
programming
turtles
web
Like Google Mail, Google Docs almost entirely consists of obfuscated JavaScript, some of it common between the two. Its HTML structure is quite simple, though it uses hidden iframes for various purposes (one for key input and another for calculating word widths, amongst others). Over the course of the couple of months I identified over 30 distinct issues that needed fixing, and I’ll discuss the more interesting ones in the second section of this blog.
As with Gmail, I believe Flow is the only browser engine written after Google Docs that can run Google Docs.
source: HN
The end of TenFourFox and what I've learned from it
http://tenfourfox.blogspot.com/2020/04/the-end-of-tenfourfox-and-what-ive.html [tenfourfox.blogspot.com]
2021-03-29 19:10
tags:
browser
development
javascript
mac
turtles
update
We’re running on fumes technologically as well. Besides various layout and DOM features we don’t support well like CSS grid, there are large JavaScript updates we’ll increasingly need which are formidably complex tasks. The biggest is async and await support which landed in Firefox 52, and which many sites now expect to run at all. However, at the time it required substantial changes to both JavaScript and the runtime environment and had lots of regressions and bugs to pick up. We have some minimal syntactic support for the feature but it covers only the simplest of use cases incompletely. There are also front end changes required to deal with certain minifiers (more about this in a moment) but they can all be traced back to a monstrous 2.5MB commit which is impossible to split up piecemeal. We could try to port 52ESR as a whole, but we would potentially suffer some significant regressions in the process, and because there is no Rust support for 32-bit PowerPC on OS X we couldn’t build anything past Firefox 54 anyway. All it does is just get us that much closer to an impenetrable dead end. It pains me to say so, but it’s just not worth it, especially if I, the browser’s only official beneficiary, am rarely using it personally these days. It’s best to hang it up here while the browser still works for most practical purposes and people can figure out their next move, rather than vainly struggling on with token changes until the core is totally useless.
source: HN
The Kilobyte's Gambit
https://vole.wtf/kilobytes-gambit/ [vole.wtf]
2021-03-07 23:23
tags:
gaming
interactive
javascript
Can you beat 1024 of javascript at chess?
source: HN
An Exploration of JSON Interoperability Vulnerabilities
https://labs.bishopfox.com/tech-blog/an-exploration-of-json-interoperability-vulnerabilities [labs.bishopfox.com]
2021-02-26 22:29
tags:
format
javascript
security
standard
text
turtles
The same JSON document can be parsed with different values across microservices, leading to a variety of potential security risks. If you prefer a hands-on approach, try the labs and when they scare you, come back and read on.
https://github.com/BishopFox/json-interop-vuln-labs/
source: HN
Floating Point in the Browser, Part 3: When x+y=x
https://randomascii.wordpress.com/2020/10/18/floating-point-in-the-browser-part-3-when-xyx/ [randomascii.wordpress.com]
2020-10-20 04:09
tags:
browser
bugfix
javascript
programming
series
That is, if you add a small number to a large number then if the small number is “too small” then the large number may (in the default/sane round-to-nearest mode) stay at the same value.
Because of this the loop spins endlessly and the push command runs until the array hits the size limits. If there were no size limits then the push command would keep running until the entire machine ran out of memory, so, yay?
The Great CoffeeScript to Typescript Migration of 2017
https://dropbox.tech/frontend/the-great-coffeescript-to-typescript-migration-of-2017 [dropbox.tech]
2020-05-16 04:58
tags:
development
javascript
programming
This post is longer than most. We wanted to capture the massive scope of migrating hundreds of thousands of lines of CoffeeScript to TypeScript. We share how we picked TypeScript in the first place, how we mapped out the migration, and when things didn’t go according to plan.
source: HN
is-promise post mortem
https://medium.com/javascript-in-plain-english/is-promise-post-mortem-cab807f18dcc [medium.com]
2020-04-28 17:17
tags:
development
javascript
library
testing
I had been intending to set up more of my projects to be automatically published via CI, instead of manually published from my local machine, but because is-promise is such a tiny library, I figured it probably wasn’t worth the effort. This was definitely a mistake. However, even if I had setup publishing via CI is-promise may not have had sufficiently thorough tests.
source: L
Porting to TypeScript Solved Our API Woes
https://www.executeprogram.com/blog/porting-to-typescript-solved-our-api-woes [www.executeprogram.com]
2020-04-09 05:14
tags:
development
javascript
programming
type-system
web
We ported our React frontend from JavaScript to TypeScript, but left the backend in Ruby. Eventually, we ported the backend to TypeScript too.
With the Ruby backend, we sometimes forgot that a particular API property held an array of strings, not a single string. Sometimes we changed a piece of the API that was referenced in multiple places but forgot to update one of those places. These are normal dynamic language problems in any system whose tests don’t have 100% test coverage. (And it will still happen even with 100% coverage; it’s just less likely.)
Fixing memory leaks in web applications
https://nolanlawson.com/2020/02/19/fixing-memory-leaks-in-web-applications/ [nolanlawson.com]
2020-02-21 15:33
tags:
garbage-collection
javascript
programming
web
Part of the bargain we struck when we switched from building server-rendered websites to client-rendered SPAs is that we suddenly had to take a lot more care with the resources on the user’s device. Don’t block the UI thread, don’t make the laptop’s fan spin, don’t drain the phone’s battery, etc. We traded better interactivity and “app-like” behavior for a new class of problems that don’t really exist in the server-rendered world.
One of these problems is memory leaks. A poorly-coded SPA can easily eat up megabytes or even gigabytes of memory, continuing to gobble up more and more resources, even as it’s sitting innocently in a background tab. At this point, the page might start to slow to a crawl, or the browser may just terminate the tab and you’ll see Chrome’s familiar “Aw, snap!” page.
Don't touch my clipboard
https://alexanderell.is/posts/taking-over-my-clipboard/ [alexanderell.is]
2020-02-18 05:07
tags:
browser
javascript
programming
ux
web
You can (but shouldn’t) change how people copy text from your website.
source: HN
The Curious Case of WebCrypto Diffie-Hellman on Firefox - Small Subgroups Key Recovery Attack on DH
https://blog.intothesymmetry.com/2020/01/the-curious-case-of-webcrypto-diffie.html [blog.intothesymmetry.com]
2020-01-16 02:08
tags:
browser
crypto
exploit
javascript
security
Mozilla Firefox prior to version 72 suffers from Small Subgroups Key Recovery Attack on DH in the WebCrypto’s API. The Firefox’s team fixed the issue removing completely support for DH over finite fields (that is not in the WebCrypto standard). If you find this interesting read further below.
source: green
Unintuitive JSON Parsing
https://nullprogram.com/blog/2019/12/28/ [nullprogram.com]
2019-12-30 23:30
tags:
compiler
format
javascript
Based on the title, could be just about anything...
The parser will not complain about leading zeros because JSON has no concept of leading zeros.
Unexpectedly a parse error, not a lex error.
Improving the Cryptography of the JavaScript Ecosystem
https://paragonie.com/blog/2019/10/improving-cryptography-javascript-ecosystem [paragonie.com]
2019-10-19 21:58
tags:
crypto
javascript
library
release
security
This month we released Sodium-Plus, a pluggable, cross-platform, type-safe interface for libsodium to make it easier to write safe and secure JavaScript cryptography code.
source: green
Remote Code Execution in Firefox beyond memory corruptions
https://frederik-braun.com/firefox-ui-xss-leading-to-rce.html [frederik-braun.com]
2019-09-29 18:52
tags:
browser
exploit
html
javascript
security
turtles
ux
Browsers are complicated enough to have attack surface beyond memory safety issues. This talk will look into injection flaws in the user interface of Mozilla Firefox, which is implemented in JS, HTML, and an XML-dialect called XUL. With an Cross-Site Scripting (XSS) in the user interface attackers can execute arbitrary code in the context of the main browser application process. This allows for cross-platform exploits of high reliability. The talk discusses past vulnerabilities and will also suggest mitigations that benefit Single Page Applications and other platforms that may suffer from DOM-based XSS, like Electron.
source: L