Limit metadata to 10 MiB
If fetching GPG-signed commits over plain HTTP, a MitM attacker can fill up the drive of targets by simply returning an enormous stream for the commit object. Related to this, an attacker can also cause OSTree to perform large memory allocations by returning enormous GVariants in the metadata. This helps close that attack by limiting all metadata objects to 10 MiB, so the initial fetch will be truncated. But now the attack is only slightly more difficult as the attacker will have to return a correctly formed commit object, then return a large stream of < 10 MiB dirmeta/dirtree objects. https://bugzilla.gnome.org/show_bug.cgi?id=725921
This commit is contained in:
1 parent
6002356747
commit
47610b45c2
8 files changed
+221
-31
No files matched your search
@@ -29,9 +29,19 @@ G_BEGIN_DECLS
|
||||
/**
|
||||
* OSTREE_MAX_METADATA_SIZE:
|
||||
*
|
||||
* Maximum permitted size in bytes of metadata objects.
|
||||
* Maximum permitted size in bytes of metadata objects. This is an
|
||||
* arbitrary number, but really, no one should be putting humongous
|
||||
* data in metadata.
|
||||
*/
|
||||
#define OSTREE_MAX_METADATA_SIZE (1 << 26)
|
||||
#define OSTREE_MAX_METADATA_SIZE (10 * 1024 * 1024)
|
||||
|
||||
/**
|
||||
* OSTREE_MAX_METADATA_WARN_SIZE:
|
||||
*
|
||||
* Objects committed above this size will be allowed, but a warning
|
||||
* will be emitted.
|
||||
*/
|
||||
#define OSTREE_MAX_METADATA_WARN_SIZE (7 * 1024 * 1024)
|
||||
|
||||
/**
|
||||
* OSTREE_MAX_RECURSION:
|
||||
|
||||
Reference in new issue
Block a user