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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:57:33+00:00 2026-05-24T16:57:33+00:00

I am using ColdFusion 9 and jQuery. I am new pretty new to using

  • 0

I am using ColdFusion 9 and jQuery.

I am new pretty new to using ColdFusion CFCs via CFAJAXPROXY. I am curious as to whether my database is at risk and how I might easily patch security holes.

I put this at the top of the page:

<cfajaxproxy cfc="brands" jsclassname="jsApp">

Here’s a CFC that is used after some logs in:

<!--- ADD BRAND  --->
<cffunction name="addBrand" access="remote">
    <cfargument name="SiteID" required="true">
    <cfargument name="Brand" required="true">
    <cfscript>
        LOCAL.SiteID = ARGUMENTS.SiteID;
        LOCAL.Brand = trim(left(ARGUMENTS.Brand, 50));
    </cfscript>
    <cfquery name="GetBrands">
        INSERT INTO Brands(SiteID, Brand)
        VALUES      (<cfqueryparam cfsqltype="cf_sql_integer" value="#LOCAL.SiteID#">,
                    <cfqueryparam cfsqltype="cf_sql_varchar" value="#LOCAL.Brand#">)
    </cfquery>
    <cfreturn true>
</cffunction>

Here’s the jQuery that would post the data to the CFC

$("#AddBrand").click(function() {
    NewBrand = $("#NewBrand").attr("value");
    var jro = new jsApp();
    jro.addBrand(NewBrand);
});

So, is there a big security hole here? Should access=”remote” be used only for retrieving data?

  • 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-24T16:57:34+00:00Added an answer on May 24, 2026 at 4:57 pm

    No, access=’remote’ does not need to be used only for retrieving data, but it does need to be used carefully and with an understanding of the security implications.

    The way you have that set right now, anyone would be able to make a call to insert something into your DB (assuming there are no other access controls that we are not seeing). So you probably should be implementing some type of access control to protect this and other functions.

    Now I am going to assume that you did not put the word “easily” in your question and I am going to put in the word “practically” instead. When it comes to security, there is rarely an “easy”.

    So there are several ways you could protect these methods. A lot depends on how you want to do it and what you are doing already.

    1. If you are using <cflogin> you may be able to add roles="<Your Admin role name>" to the function. I have never tried this, but I suspect it would work. (Personally, I do not like this method for several reasons, but it is an option)

    2. You can put some sort of authorization code at the top of the function.

    <cfif NOT mySecurityCFC.isAuthorized(COOKIE.CFID,COOKIE.CFTOKEN)><cfreturn /></cfif>

    I don’t like this method either.

    1. You could use the new onCFCRequest() method of App.cfc in ColdFusion 9 to intercept requests and run them through your authorization routine. This is cleaner than option 2. I would say this is the easiest option, and would work effectively, but I, personally like option 4 better.

    2. The ColdSpring project has some great tools for automatically creating and working with remote proxy objects that can also incorporate security through Aspect-Oriented Programming (AOP). The combination of remote proxies and AOP is extremely powerful and can allow you to create the remote methods without exposing the real underlying objects and to intercept and authorize each request to those methods without having to stich code into every method. In fact, the methods themselves are not even aware they are being secured.

    I would choose option 4. It may sound like a daunting and extremely high-level process, and in some ways it is, but it is actually quite a lot easier than you might think to implement. The steps are outlined in the ColdSpring quick start guide. http://www.coldspringframework.org/index.cfm/go/documentation

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

Sidebar

Related Questions

I am using ColdFusion 9 and jQuery. I am using CFAJAXPROXY. I have am
I've got a successful call going out to a coldfusion database controller using jQuery's
I'm using ColdFusion to return a result set from a SQL database and turn
I am using this new jQuery plugin called jsTree www.jstree.com and using the HTML
I am using ColdFusion (Railo 3.3), and I have several forms using jQuery that
I'm using coldfusion and jquery. This is my first real go at jquery and
How do I post a form using jQuery.post() to a Coldfusion.cfc method and return
I am using ColdFusion 9.0.1 and jQuery 1.6.2. I am doing an call using
I am using ColdFusion 9 and the latest and greatest jQuery. At the top
I am using ColdFusion 8.0.1 and jQuery 1.4.3 I am passing values to a

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.