diff options
author | Darian Anthony Patrick <dpatrick@wikimedia.org> | 2016-04-19 10:53:39 -0700 |
---|---|---|
committer | Chad Horohoe <chadh@wikimedia.org> | 2016-05-20 09:49:02 -0700 |
commit | 43f70b84b3a78baf46d519fefefe0e7b32c89f3b (patch) | |
tree | 96c1a9c8339052d9dfbea452fb77a142cab67328 /includes/Defines.php | |
parent | f91e47ce9e0d115016ed51e33356134260c5dc92 (diff) | |
download | mediawikicore-43f70b84b3a78baf46d519fefefe0e7b32c89f3b.tar.gz mediawikicore-43f70b84b3a78baf46d519fefefe0e7b32c89f3b.zip |
Enforce upper limit on invocations of wfShellExec()
Enforce an upper limit of 100,000 bytes on commands executed via
wfShellExec() to avoid HHVM crash resulting from process spawned with
argument exceeding MAX_ARG_STRLEN, as defined in binfmts.h
Bug: T129506
Signed-off-by: Chad Horohoe <chadh@wikimedia.org>
Diffstat (limited to 'includes/Defines.php')
-rw-r--r-- | includes/Defines.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/includes/Defines.php b/includes/Defines.php index 9a6950e08104..19a08eff8445 100644 --- a/includes/Defines.php +++ b/includes/Defines.php @@ -305,3 +305,9 @@ define( 'CONTENT_FORMAT_JSON', 'application/json' ); // for future use with the api, and for use by extensions define( 'CONTENT_FORMAT_XML', 'application/xml' ); /**@}*/ + +/**@{ + * Max string length for shell invocations; based on binfmts.h + */ +define( 'SHELL_MAX_ARG_STRLEN', '100000'); +/**@}*/ |