You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm triaging the issue mdn/content#44590, which says there may be a risk with IndexedDB/OPFS in that they allow sites to, without user consent, modify the file system at a very high throughput, and may wear down the SSD in the process.
I've never heard of it being an identified attack vector or that there's any motive for anyone to do so, but it does sound like something users can be concerned with.
Has the WG ever thought about how implementations could help mitigate this, such as options to lower the threshold, rate-limit, buffer in memory, etc.? I didn't find related considerations in https://w3c.github.io/IndexedDB/#security, but it does look like browsers already buffer IndexedDB in memory.
Chromium does not have any mitigations against this and to my knowledge it has never been identified as an active attack vector. DOS in general is seen as a kind of abuse, but not security-relevant, and as such receives less attention. I think if we had field reports of malicious sites actually doing something like the user's described concern, we'd need to carefully consider how to mitigate it. The only thing that's even close to this is that persistent storage requires a permission, which is granted by user dialog in FF and by heuristics in Chromium.
browsers already buffer IndexedDB in memory.
Chromium does not do this beyond whatever the OS page cache does.
Chromium does (heavily) buffer Local Storage in memory, but that also leads to a lot of data loss on crashes, and it's more practical because Local Storage has a much lower size cap.
One additional concern here, it seems like an entire IndexedDB instance for one site could easily remain in-memory, hence the browser could decide to buffer all writes in memory and only occasionally write to disk. I don't know if browsers are smart enough to do that - perhaps this should be mandated by the standard if not already the case? - but assuming they are then there isn't much risk of bothering the SSD here since writes to IndexedDB wouldn't really directly correspond with disk writes.
However, the OPFS storage limit is so large that this is impossible and writes just need to go always to disk if you really push it. This in my opinion increases the danger for abusing it to damage hardware via SSD writes (rather than just, as you probably correctly say is a minor issue, do a denial of service by slowing the browser down).
I think the fundamental problem is that absent human-level analysis it's impossible for a browser to determine whether a site actually needs storage, whether it's efficiently minimizing its storage use, or if it's got a buggy implementation. And a real limitation is that most sites will entirely break if denied storage and aren't interested in correcting that. (That said, note that Firefox's tracking protection mechanism does try and maintain a known set of trackers and either tries to avoid loading the scripts or denies them access to storage.)
This makes it hard for the browser to usefully do anything in terms of informed user consent, especially without creating prompt fatigue problems, as in many cases the situation ends up being "press allow if you want to keep using the site / let the site work" and the user's decision to not close the tab or hit the back button is effectively already the same thing. That said, I think there is some possibility for browsers to have a storage analog of the "slow site" info-bar Firefox pops up if a site's JS is making the tab/browser unresponsive. The storage analog could be noting how much I/O the site has done and whether it seems commensurate with the user's interaction with the site (to attempt to mitigate a situation where a user might be using a web video editor and have it suddenly stop working part-way through a long batch process). But there's again risk with this since if JS is allowed to continue to execute and if there are no data-dependencies on intentionally stalled storage APIs or backpressure handling it may continue to issue requests against storage APIs that accumulate in memory until an OOM happens. That might be something that could be mentioned non-normatively in the WHATWG storage spec but I'm not sure it would impact specific storage specs like IDB.
I should also note that most browsers do have some kind of privacy-preserving "known bad site" mechanism; Firefox uses Google's Safe Browsing service as does Chrome, and I believe Edge has its own database. In the event there are sites out there intentionally and maliciously, that's arguably a major part of a mechanism for mitigating, especially since that can be augmented by automated crawling that detects hostile patterns/runtime behaviors but without slowing individual user's browsing or needing their private usage data.
In terms of buffering, because IndexedDB explicitly has transactional semantics (which section 2.7 calls "durable"), I think specifying any kind of memory buffering would be at odds with the spec.
But I'd also note that buffering IDB data in memory could itself lead to SSD churn by causing virtual memory swapping (to SSD), although my greater concern would be causing browser OOM crashes. https://data.firefox.com/dashboard/hardware says that users with 8GB of RAM are still the most populous. I think there's also the question of whether a site that could safely fit its IDB data in memory is the kind of site that actually would be causing high levels of SSD churn. (A caveat is trackers again might fit this classification, as it is an unfortunately common idiom for sites to want to report user activity on the site and to buffer it to storage in case of transient transmission failure, although we expect that to be O(user activity on the site) rather than a non-stop I/O flood. But again in Firefox if we can know something is a tracker we have special user-controllable handling that attempts to mitigate the tracking entirely rather than the I/O impact.)
Well for example, some browsers (I believe this includes LibreWolf, not sure if Firefox out of the box) ask whether a site can store local data permanently at all. However, I'm not sure if OPFS is disabled until that is confirmed, it might not be. But a spec could encourage that it is and that IndexedDB is in-memory only, before such an opt-in prompt is confirmed.
In terms of buffering, because IndexedDB explicitly has transactional semantics (which section 2.7 calls "durable"), I think specifying any kind of memory buffering would be at odds with the spec.
For what it's worth, I assume the spec could be changed if a big enough security concern is found.
Activity
evanstade commentedon Oct 29, 2026
Chromium does not have any mitigations against this and to my knowledge it has never been identified as an active attack vector. DOS in general is seen as a kind of abuse, but not security-relevant, and as such receives less attention. I think if we had field reports of malicious sites actually doing something like the user's described concern, we'd need to carefully consider how to mitigate it. The only thing that's even close to this is that persistent storage requires a permission, which is granted by user dialog in FF and by heuristics in Chromium.
Chromium does not do this beyond whatever the OS page cache does.
Chromium does (heavily) buffer Local Storage in memory, but that also leads to a lot of data loss on crashes, and it's more practical because Local Storage has a much lower size cap.
ell1e commentedon Nov 6, 2026
How is it just denial of service if it actively damages the hardware?
ell1e commentedon Nov 6, 2026
One additional concern here, it seems like an entire IndexedDB instance for one site could easily remain in-memory, hence the browser could decide to buffer all writes in memory and only occasionally write to disk. I don't know if browsers are smart enough to do that - perhaps this should be mandated by the standard if not already the case? - but assuming they are then there isn't much risk of bothering the SSD here since writes to IndexedDB wouldn't really directly correspond with disk writes.
However, the OPFS storage limit is so large that this is impossible and writes just need to go always to disk if you really push it. This in my opinion increases the danger for abusing it to damage hardware via SSD writes (rather than just, as you probably correctly say is a minor issue, do a denial of service by slowing the browser down).
asutherland commentedon Nov 8, 2026
I think the fundamental problem is that absent human-level analysis it's impossible for a browser to determine whether a site actually needs storage, whether it's efficiently minimizing its storage use, or if it's got a buggy implementation. And a real limitation is that most sites will entirely break if denied storage and aren't interested in correcting that. (That said, note that Firefox's tracking protection mechanism does try and maintain a known set of trackers and either tries to avoid loading the scripts or denies them access to storage.)
This makes it hard for the browser to usefully do anything in terms of informed user consent, especially without creating prompt fatigue problems, as in many cases the situation ends up being "press allow if you want to keep using the site / let the site work" and the user's decision to not close the tab or hit the back button is effectively already the same thing. That said, I think there is some possibility for browsers to have a storage analog of the "slow site" info-bar Firefox pops up if a site's JS is making the tab/browser unresponsive. The storage analog could be noting how much I/O the site has done and whether it seems commensurate with the user's interaction with the site (to attempt to mitigate a situation where a user might be using a web video editor and have it suddenly stop working part-way through a long batch process). But there's again risk with this since if JS is allowed to continue to execute and if there are no data-dependencies on intentionally stalled storage APIs or backpressure handling it may continue to issue requests against storage APIs that accumulate in memory until an OOM happens. That might be something that could be mentioned non-normatively in the WHATWG storage spec but I'm not sure it would impact specific storage specs like IDB.
I should also note that most browsers do have some kind of privacy-preserving "known bad site" mechanism; Firefox uses Google's Safe Browsing service as does Chrome, and I believe Edge has its own database. In the event there are sites out there intentionally and maliciously, that's arguably a major part of a mechanism for mitigating, especially since that can be augmented by automated crawling that detects hostile patterns/runtime behaviors but without slowing individual user's browsing or needing their private usage data.
In terms of buffering, because IndexedDB explicitly has transactional semantics (which section 2.7 calls "durable"), I think specifying any kind of memory buffering would be at odds with the spec.
But I'd also note that buffering IDB data in memory could itself lead to SSD churn by causing virtual memory swapping (to SSD), although my greater concern would be causing browser OOM crashes. https://data.firefox.com/dashboard/hardware says that users with 8GB of RAM are still the most populous. I think there's also the question of whether a site that could safely fit its IDB data in memory is the kind of site that actually would be causing high levels of SSD churn. (A caveat is trackers again might fit this classification, as it is an unfortunately common idiom for sites to want to report user activity on the site and to buffer it to storage in case of transient transmission failure, although we expect that to be O(user activity on the site) rather than a non-stop I/O flood. But again in Firefox if we can know something is a tracker we have special user-controllable handling that attempts to mitigate the tracking entirely rather than the I/O impact.)
ell1e commentedon Nov 8, 2026
Well for example, some browsers (I believe this includes LibreWolf, not sure if Firefox out of the box) ask whether a site can store local data permanently at all. However, I'm not sure if OPFS is disabled until that is confirmed, it might not be. But a spec could encourage that it is and that IndexedDB is in-memory only, before such an opt-in prompt is confirmed.
ell1e commentedon Nov 8, 2026
For what it's worth, I assume the spec could be changed if a big enough security concern is found.