Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6989597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:13:59+00:00 2026-05-27T19:13:59+00:00

Hi guys i have this line of code in a perl script where i

  • 0

Hi guys i have this line of code in a perl script where i allow users to upload a 5 second microphone recording to my server. The flash that does the recording automatically limits the microphone to 5 seconds and then POSTs the recording to my server.

 read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});

Now my question is if someone wanted to be malicious they could directly post to my server script using up internal memory, bandwidth, and possibly buffer overflow. Is there a way to prevent how much information comes from the user?

I tried this before the read line, but I am not entirely sure this is the correct way to do it. Any ideas? Thanks.

if ($ENV{'CONTENT_LENGTH'} > 100000) {
 #then return some error message / exit
}

EDIT AND SOLUTION TO MY PROBLEM:

 use CGI qw/:standard/;
 use CGI::Carp 'fatalsToBrowser';
 $CGI::POST_MAX=1024 * 100;  # max 100K posts
 #$CGI::DISABLE_UPLOADS = 1;  # no uploads

 $uploaded_file = param( 'POSTDATA' );
 if (!$uploaded_file && cgi_error()) {
  print header(-status=>cgi_error());
  exit 0;
 }

I want to thank all of you for your quick responses (upvotes for all) but i have to give the correct answer to the first person who posted the correct link, despite their lack of effort in writing anything. I guess thats only fair? What do you guys think, leave comment below.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:13:59+00:00Added an answer on May 27, 2026 at 7:13 pm

    You say it is a Perl script but don’t mention the Perl CGI.pm module. If you use that module (which I recommend), there is some limited support for denial-of-service protection. For example, you can set:

    $CGI::POST_MAX = 100000;
    

    and CGI.pm will exit your script with an error if any posts that are too large show up.

    There’s a decent discussion of how to avoid denial-of-service attacks in the man page.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I wrote this code and i have two errors. Invalid rank specifier:
Hi guys I have this code that checks linkback: $reciprocal_linkback = reciprocal_linkback($contenturl,http://www.mydomain.com,1); if ($reciprocal_linkback==0)
Hello guys I have 1675 line Code. Want to when user click button textbox.text
hey there guys and girls i have this code that should download a json
guys i have arrays in which i have to match this kind of text
Thus far you guys have been wildly helpful with me getting this little ditty
Can you guys help me figure this out? I have the following JavaScript snippet:
Ok guys, I have a serious problem with this. I have a static class
Hey guys, this is simple but I can't make it workn... blah! I have
I hope some of you guys can help me with this problem.... I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.