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 6370031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:52:44+00:00 2026-05-25T00:52:44+00:00

I have a bunch of external forms that post data into databases via CFC’s.

  • 0

I have a bunch of external forms that post data into databases via CFC’s.

What I do is

  1. Create the form w/ a postback
  2. In the post back create an object and map form data to the object (cfc)
  3. Use CFparam to do validation on the type and store in THIS. scope
  4. Call a custom method to scan strings to sterilize them from attacks (seems to work well)
  5. Cfquery to insert.

Is there anything else I can or should be doing to secure the application from SQL attacks on insert? I use CFqueryParam on select statements, should I also use in insert statements?

Example of a simple CFC:

<!--- Instance Veriables ---> 
<cfparam name="THIS.firstPrintedField" type="string" default="#NullString#" />
<cfparam name="THIS.SecondPrintedField" type="string" default="#NullString#" />
<cfparam name="THIS.participantFullName" type="string" default="#NullString#" />
<cfparam name="THIS.studentStatus" type="string" default="#NullString#" />
<cfparam name="THIS.dob" type="date" default="#NullDate#" />
<cfparam name="THIS.readAndUnderStood_Day" type="string" default="#NullString#" />
<cfparam name="THIS.readAndUnderStood_Month" type="string" default="#NullString#" />
<cfparam name="THIS.readAndUnderStood_Year" type="string" default="#NullString#" />
<cfparam name="THIS.agreeToTerms" type="boolean" default="#NullBool#" /> 
<cfparam name="THIS.guardianFirstName" type="string" default="#NullString#" />
<cfparam name="THIS.guardianMiddleName" type="string" default="#NullString#" />
<cfparam name="THIS.guardianLastName" type="string" default="#NullString#" />
<cfparam name="THIS.DateTimeSubmited" type="date" default="#NullDate#" />

<cffunction access="public" name="addRecords" returntype="boolean">
    <cftry> 
        <!--- Sanitize the string properties --->
        <cfset Sanitize() />
        <cfquery datasource="#DSN#" name="qryAddRecords">
            INSERT INTO mod_OutdoorProgram_Waivers
            (
                firstPrintedField
                ,SecondPrintedField
                ,participantFullName
                ,studentStatus
                ,dob
                ,readAndUnderStood_Day
                ,readAndUnderStood_Month
                ,readAndUnderStood_Year
                ,agreeToTerms
                ,guardianFirstName
                ,guardianMiddleName
                ,guardianLastName
            )
            VALUES
            (
                '#THIS.firstPrintedField#'
                ,'#THIS.SecondPrintedField#'
                ,'#THIS.participantFullName#'
                ,'#THIS.studentStatus#'
                ,'#THIS.dob#'
                ,'#THIS.readAndUnderStood_Day#'
                ,'#THIS.readAndUnderStood_Month#'
                ,'#THIS.readAndUnderStood_Year#'
                ,'#THIS.agreeToTerms#'
                ,'#THIS.guardianFirstName#'
                ,'#THIS.guardianMiddleName#'
                ,'#THIS.guardianLastName#'
            )
        </cfquery>
        <cfcatch><cfreturn false /></cfcatch>
    </cftry>
        <cfreturn true />       
</cffunction>
  • 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-25T00:52:44+00:00Added an answer on May 25, 2026 at 12:52 am

    cfqueryparam should be used everywhere, as it is ColdFusions sql injection vulnerability solution.

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

Sidebar

Related Questions

I have a Junit process that runs a bunch of data integrity tests every
I have a project with a bunch of external sounds to a SWF. I
I have a bunch of files that I need to be able to transport
I have a bunch of latitude/longitude pairs that map to known x/y coordinates on
I have a bunch of .NET frameworks installed on my machine. I know that
I have a bunch of perfmon files that have captured information over a period
I have a bunch (hundreds) of files that are supposed to have Unix line
We have a Mono application under Linux that does image processing on a bunch
I've got an application here that needs to read in a bunch of data
I have a PHP page that needs to make a call to a external

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.