mirror of
https://git.openafs.org/openafs.git
synced 2025-01-31 05:27:44 +00:00
OPENAFS-SA-2018-003 budb: prevent unbounded input to BUDB_SaveText
BUDB_SaveText is defined with an input parameter that is defined to XDR as an unbounded array of chars: typedef char charListT<>; RPCs with unbounded arrays as inputs are susceptible to remote denial-of-service (DOS) attacks. A malicious client may submit a BUDB_SaveText request with an arbitrarily large array, forcing the budb server to expend large amounts of network bandwidth, cpu cycles, and heap memory to unmarshal the input. Modify the XDR definition of charListT so it is bounded. This typedef is shared (as an OUT parameter) by BUDB_GetText and BUDB_DumpDB, but fortunately all in-tree callers of the client routines specify the same maximum length of 1024. Note: However, SBUDB_SaveText server implementation seems to allow for up to BLOCK_DATA_SIZE (2040) = BLOCKSIZE (2048) - sizeof(struct blockHeader) (8), and it's unknown if any out-of-tree callers exist. Since we do not need a tight bound in order to avoid the DoS, use a somewhat higher maximum of 4096 bytes to leave a safety margin. [kaduk@mit.edu: bump the margin to 4096; adjust commit message to match] (cherry picked from commit 124445c0c47994f5e2efef30e86337c3c8ebc93f) (cherry picked from commit 87f199c14199afa29f75bb336383564f0fb4548a) (cherry picked from commit c5c3a858b21eaaabda46e1dffdea038fa234d657) Change-Id: I6802e76a5f6e39e31ece66d1ff00ed11b47b6c36
This commit is contained in:
parent
e3840eb1a2
commit
b8142be4b4
@ -224,7 +224,7 @@ typedef struct budb_volumeEntry budb_volumeList<BUDB_MAX_RETURN_LIST>;
|
||||
typedef struct budb_dumpEntry budb_dumpList<BUDB_MAX_RETURN_LIST>;
|
||||
typedef struct budb_tapeEntry budb_tapeList<BUDB_MAX_RETURN_LIST>;
|
||||
typedef afs_int32 budb_dumpsList<BUDB_MAX_RETURN_LIST>;
|
||||
typedef char charListT<>;
|
||||
typedef char charListT<4096>;
|
||||
|
||||
%#define BUDB_TEXT_COMPLETE 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user