Skip to content

Commit ca81e55

Browse files
bbrehmmpollmeier
andauthored
add some docs regarding security (#335)
* add some docs regarding security * Update README.md Co-authored-by: Michael Pollmeier <[email protected]> * Update README.md Co-authored-by: Michael Pollmeier <[email protected]> * Update README.md Co-authored-by: Michael Pollmeier <[email protected]> * Update README.md Co-authored-by: Michael Pollmeier <[email protected]> * clean up more types --------- Co-authored-by: Michael Pollmeier <[email protected]>
1 parent 485e30b commit ca81e55

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,18 @@ generated schema (as opposed to an ad-hoc schema infered from the graph data).
490490
The build targets JDK8, so that's the minimum version. The build itself requires JDK11+.
491491
However in any case it is highly encouraged to use a modern JVM, such as JDK20.
492492

493+
## What about security / untrusted flatgraph files?
494+
The main potential security issue is probably: how can you handle an untrusted - and potentially malicious - flatgraph file?
495+
Deserializing a `.fg` file should not be able to open a shell or cause privilege escalation, nor should it cause excessive filesystem activity. However, it may take an
496+
unbounded amount of time and memory, potentially leading to an OutOfMemoryError, and potentially bringing down the JVM or even, depending on configuration, the system (off-heap allocations via `ByteBuffer.allocateDirect` do not necessarily respect the maximum heap size, and the OOM-killer is not gentle).
497+
498+
The easiest malicious but completely valid `.fg` file in that vein is a ZIP-bomb. We take care not to decompress graphs into the filesystem, but we do decompress them into memory.
499+
500+
If you need to handle untrusted `.fg` files, then you should really sandbox your process, in order to limit the DoS impact.
501+
502+
If you decide to rather sanity check graphs before loading, then we would be happy for PRs; however, this is not our current development priority, nor is it our recommendation. In that case, also beware of potential parser differentials; e.g. the manifest json can be reached either via the offset from the file header, or via `tail -n 1`, and these may very well be different manifests.
503+
504+
493505
## What does EMT stand for?
494506
EMT is a naming convention that stands for "erased marker trait".
495507
The domain classes generator generates one for each property in the schema and users can define additional marker traits.

0 commit comments

Comments
 (0)