summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authorchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-08 19:36:23 +0000
committerchristopherm <christopherm@4979c152-3d1c-0410-bac9-87ea11338e46>2008-07-08 19:36:23 +0000
commitb9d31615182994d1ad9d883c6c364979ac0aa040 (patch)
treef5c4d2c7a3680fc17bc4e6bb3dcee33ed41e54ba /LedgerSMB
parent8176af5e128b19af81d509450027e59471a54559 (diff)
CONTENT_LENGTH is a user supplied variable. Without any checks for size, one could easily DoS the machine with very large POSTS
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2196 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rw-r--r--LedgerSMB/Form.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index cb938c8d..b8cd8f70 100644
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -89,6 +89,11 @@ sub new {
my $argstr = shift;
+ if ($ENV{CONTENT_LENGTH} > $LedgerSMB::Sysconfig::max_post_size; ) {
+ print "Status: 413\n Request entity too large\n\n";
+ die "Error: Request entity too large\n";
+ }
+
read( STDIN, $_, $ENV{CONTENT_LENGTH} );
if ($argstr) {