google / google/leveldb

Usage through IndexedDB results in ldb files that never get deleted

Open
#783 6 comments 22 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
39.4k
Forks
8.2k
PR merge metrics
No merged PRs in 30d

Description

There have been a few issues opened related to this, but seemingly none are prioritized, when this seems to be a critical security issue?

Namely, it appears to be a "feature" that deleting records from the DB doesn't necessarily delete the underlying data from the ldb files.

- [Delete all values in level db and ldb files still exist!](https://github.com/google/leveldb/issues/487)
> It's by design. actually delete is also a put operation. you could db::compact force to remove some ldb files.

I realize this comment was made by an outside party, but the issue was closed thereafter with no comment.

Neither does deleting the entire database altogether. The ldb file remains.

- [Leftover .ldb file](https://github.com/google/leveldb/issues/593)
- [DestroyDB() doesn't remove .ldb files](https://github.com/google/leveldb/issues/214)
- [dbsize grows instead of reduce when removing large amount of data!](https://github.com/ideawu/ssdb/issues/1332)
- [Disk space used by the DB grows without bounds](https://github.com/google/leveldb/issues/603)

How can one possibly store sensitive information in LevelDB/IndexedDB if deleting a database does not necessarily mean the data is actually deleted?

In our case, we use IndexedDB to store sensitive data. The user has the option to "sign out and clear local data". But we can't deliver on that promise because of lingering ldb files.

Is there any hope for this issue to be prioritized? If not, can you recommend a workaround as accessible through the IndexedDB API based on your knowledge of engine internals? This [answer](https://stackoverflow.com/a/15870554) suggests a hack of purging old data by writing 4 MB of dummy data, but it doesn't appear to work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.