YNOT
  • Home
  • Industry News
    • Adult Business News
    • Adult Novelty News
    • YNOT Magazine
    • EU News
    • Opinions
    • Picture Galleries
  • PR Wire
    • Adult Company News
    • Adult Retail News
    • Adult Talent News
    • Adult Videos News
  • Podcasts
  • Industry Guides
    • Adult Affiliate Guide
    • Affiliate Marketing for Beginners
    • Top Adult Traffic Networks
    • Top Adult PR Agents
    • Funding an Adult Business
  • Business Directory
    • View Categories
    • View Listings
    • Submit Listing
  • Newsletters
  • Industry Events
    • Events Calendar
    • YNOT Cam Awards | Hollywood
    • YNOT Awards | Prague
    • YNOT Cammunity
    • YNOT Summit
    • YNOT Reunion
  • Login with YNOT ID
YNOT University: Educational articles and tutorials

Perl, CGI and Secure Coding

Posted On 08 May 2000
By : admin

After a recent post on our message board and reading up a little bit here and there, I figured
I’d go ahead and write an article on security for a change. Most of us (programmers that is)
already know what I’m about to write (or they -should- know) but for newbies it might
be interesting.

First of all, is Perl a secure language? That really depends on the programmer.After a recent post on our message board and reading up a little bit here and there, I figured
I’d go ahead and write an article on security for a change. Most of us (programmers that is)
already know what I’m about to write (or they -should- know) but for newbies it might
be interesting.

First of all, is Perl a secure language? That really depends on the programmer. It’s the same
as driving really, you can either drive like a maniac or drive defensively. It’s the same
with Perl programs. If you code like a maniac without thinking about what your code
actually does, well, let’s just say the results could be ugly.

Case in point, the message on the messageboard pointed out a rather simple flaw. Simple, yes,
far-fetching results, hell yes. I tried fiddling with it and ended up with a copy of /etc/passwd
(the Unix password file). In itself not that big of a deal, but still it’s information you
don’t want just anyone to read.

Here’s the trick to secure coding: Think. If you think about what your code does, where
the input from form fields goes, what’s done with the output, you are half way there.
The other 50% of the secure coding exercise is using Perl’s taint checking (the -t flag).
Taint checking will die() your script with an error if you are using data that is ‘contaminated’.
Contaminated means that it’s unchecked, and might (or might not) contain data that will get
you a whole lot of other results than the ones you hoped for.

Since taint checking is a rather long-winded subject, I’d like to refer everyone to their
perl documentation (those files you never read 😉 and read up on it.

Also, remember, shell commands are fun, but might cause some very serious security holes. Things
like executing shell commands using backticks or the system() call. If someone puts the
appropriate characters in that string, bad voodoo is going to come over your script. I won’t give
you detailed instructions, after all, this is not a course on hacking but an article on how
to code securely.

And so it ends, the main point here is that you should think about what your script does,
visualise it’s flow in your head, and work from there. If you have any more questions, feel
free to contact me at madcat@perlcoders.com

  • google-share
Previous Story

An Introduction to Copyright Law

Next Story

Project: Pic Post – The Ghost in the Machine, Pt.1

Leave a Reply Cancel reply

You must be logged in to post a comment.

Sponsor

YNOT Shoot Me

YNOTShootMe.com has exclusive pics from adult industry business events. Check it out!

YNOT Directory

  • CCBill
    Third Party Billing (IPSPs)
  • Joy Hollywood
    Novelty & Lingerie Distributors
  • Build The Store
    Web Design & Templates
  • Premiere Listing

    Mail Value Profits

    More Details

RECENT

POPULAR

COMMENTS

Free Speech Coalition

FSC Decries Supreme Court’s “Radical Departure from Precedent”

Posted On 30 Jun 2025

Beth McKenna has "A Very Productive Meeting" with Leilani Lei & Savvy G

Posted On 30 Jun 2025

Ricky’s Room Drops Kinky New Liz Jordan Scened

Posted On 30 Jun 2025

Vanessa, Meet Vivid

Posted On 29 Sep 2014
Laila Mickelwaite and Exodus Cry

Laila Mickelwaite, Exodus Cry and their Crusade Against Porn

Posted On 03 May 2021

Sex Toy Collective Dildo Sculptor

Posted On 19 Mar 2019

Find a good sex toy is now a problem,...

Posted On 18 Mar 2024

Thanks to the variety of sex toys, I can...

Posted On 02 Feb 2024

I understand the concerns about...

Posted On 05 Jan 2024

Sponsor

Sitemap
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy Policy