Proper DB Access usgin CFQUERY?

Your worst nightmare - after 18 months of code development
with 2 weeks left before BETA. My site experienced a SQL Injection
Attack 2 days ago. A URL pointing to China which trys to call a js
script. I am a self taught CF user who has coded many sites never
thinking it would happen to me. I have already read the many
threads on using CFPARAM to bind the DB types. So I have to go back
through hundreds of CFML files to do that. Now that I am paranoid I
am trying to figure out what else I can do on the SQL 2005 Server
side. I have always used my db_owner login password in CFQUERY to
make the connection, which is apparently a no-no. I can't find any
best practices online: 1) Should you use the username/password in
CFQUERY or just specify it in CF Admin? However, I thought if you
do that, then any call can be made directly to the DB. I heard you
should store the DB credentials in the application file encoded and
then call them as a new variable so they're not in plain text in
your CFQUERY? 2) If I setup a new role in SQL 2005, do people use
standard or the application role? 3) I fear I will keep getting hit
by the SQL injection code until everything is fixed. Not knowing
the extent of the damage how should I lock down the DB tables using
Enterprise Manager in SQL 2005? As you can see I have tons of
questions, and tons of work now that my site is targeted I know
little about DB security.

brwright wrote:
> Your worst nightmare - after 18 months of code
development with 2 weeks left
> before BETA. My site experienced a SQL Injection Attack
2 days ago. A URL
> pointing to China which trys to call a js script. I am a
self taught CF user
> who has coded many sites never thinking it would happen
to me. I have already
> read the many threads on using CFPARAM to bind the DB
types.
Not cfparam, cfqueryparam.
> So I have to go
> back through hundreds of CFML files to do that. Now that
I am paranoid I am
> trying to figure out what else I can do on the SQL 2005
Server side. I have
> always used my db_owner login password in CFQUERY to
make the connection, which
> is apparently a no-no. I can't find any best practices
online: 1) Should you
> use the username/password in CFQUERY or just specify it
in CF Admin? However, I
> thought if you do that, then any call can be made
directly to the DB. I heard
> you should store the DB credentials in the application
file encoded and then
> call them as a new variable so they're not in plain text
in your CFQUERY?
There is no clear consensus on the usage of a u/p in all
queries versus
storing the u/p in the CF Administrator. However, hardcoding
the u/p in
each cfquery statement is bad. You should create variables
for the
username and password and use those variables in your
queries. (Just
imagine in how many places you have to change the code if you
have a
security policy where you have to change all passwords every
3 months.)
> 2) If
> I setup a new role in SQL 2005, do people use standard
or the application role?
Depends. Typically dbreader/dbwriter is used for applications
that do
not use stored procedures.
> 3) I fear I will keep getting hit by the SQL injection
code until everything is
> fixed. Not knowing the extent of the damage how should I
lock down the DB
> tables using Enterprise Manager in SQL 2005?
Always.
Jochem
Jochem van Dieten
Adobe Community Expert for ColdFusion

Similar Messages

  • Does anyone know when proper music access is coming for iPhoneOS?

    Currently I would love to be able to make a visualisation app, a custom equalizer or possibly even a simple sound editing app for the iPhone, but am again thwarted by the inability of apps to properly access music stored on the device, a problem that's existed since 1.0 and has scarcely improved since, despite several promises. I have no idea if this came from actual technical problems or sheer laziness on the part of Apple's programmers, but we're now on (soon to be) version 4.0 of the leading portable media OS, and the lack of a simple ability like this is looking more and more ridiculous.
    I can understand how accessing raw sound data at the driver level might be a difficult depending on the hardware (I know even some laptop sound cards have problems with this), but this wouldn't even be necessary. All developers who wanted to develop a visualization or equalizer would need is read-only access to the music library on the phone - it would mean more work for them since they wouldn't be able to just use the built-in player for playback, but that's a better alternative than not being able to do it at all, and carries less stability and security risks than allowing 3rd-party apps to actively modify sound data as it's being played.
    I've emailed Apple three times about this and recieved no reply either time. Those of you with knowledge of the SDK betas and upcoming features, can you confirm when exactly we might be seeing this feature implemented?

    Right.
    What you've 'heard' might as well be dust in the wind. Only Apple knows.
    As an example, 3.2 is beta...who's to say it won't be 4.0 later?
    If you're not signed up, then all you have as a resource are the rumor sites, etc. As a registered dev, you can get beta materials, release notes, confidential online docs, api diffs and dig thru them. You can also submit bug reports/feature requests. Why are you worried about 'proper music access' if you're not even registered? Wanting to know before you register is just window shopping. Apple tends to focus that kind of support on people that show they are serious.
    There is a devforum that requires being a registered dev, but you'll get the same thing there. Confidential is as confidential does. Keyword: marketing.

  • Installed BT NetProtect Plus now I cannot access m...

    Hi,
    I thought I was doing the right thing by installing BT NetProtect plus on my Windows XP Pro PC however ever since I have had issues.  I can no longer browse my home network to access shared files - when I double-click my workgroup I get an error of 'MSHOME is not accessible, you may not have permission to use this network resource'.  I did not get this prior to the installation.   I tried initially just disabling the firewall - at least this allowed other PCs to browse the shares on my PC but it did not help on my PC. 
    I have now uninstalled NetProtect Plus but this has not resolved the issue.  It would seem that the software has changed some setting but not reset it when removed.
    I do have File and Printer sharing enabled on my PC
    I have enabled WINS
    I do have the Computer Browser Service running
    All of these were suggestions on the Internet.  Still no luck. 
    Please any other suggestions would be most welcome as I need to be able to access the network for my work.

    Some things that might be worth checking.
    The account/share password if any is still correct.
    The Log On  credentials for the appropriate System Services are still correct (cross check any details using your other PCs )
    The User/Admin Account you are using still has the proper credentials & access rights, particularly to the folders you have shared.
    "I have this awful feeling someone is watching every move I make (one of my pet hates is router location tagging)." Marvin (A paranoid Android)

  • Dynamic column name in cfquery

    I have a scenario in which database column names are in a
    format COLUMN1, COLUMN2, ...COLUMNn. Number of column is not known
    while coding. But usually the column names are hard code while
    accessing the cfquery result like
    cfqueryresult.COLUMN1.
    I want to get the column names from
    'cfqueryresult.ColumnList' and from that result i want to fetch the
    column values.
    Is it possible to achieve this in coldfusion?

    quote:
    Originally posted by:
    Dan Bracuk
    quote:
    Originally posted by:
    Newsgroup User
    And then start planing for the normalization of your database
    because that is a classic de-normalized pattern that just leads to
    more and more difficulties maintaining your application. Just like
    this one you have just experienced!
    That wasn't my interpretation. I have some reports where the
    contents of a select clause depend on user input. It results in a
    similar scenario to what was described in the OP.
    Or maybe the OP was trying to write generic code that could
    be applied to arbitrary tables.
    That was the situation which resulted in my question that you
    and Ian answered so helpfully: I use an Access template in which
    there are forms to facilitate entry of value lists (list-id, value,
    and label) and a metatable that describes each column of the actual
    working table , identifies any value-list that column references,
    and includes the prompt and (after processing) the HTML for that
    web page element. After I define the working table in the metatable
    I run a VB procedure that creates the working table and generates
    all the HTML in the metatable. Finally my generic ASP (and, coming
    soon, ColdFusion) references the metatable and the working table to
    generate an empty form, display a form populated from a DB row for
    editing, assign form values to a DB row, or delete a DB row. Same
    code, any table; all I have to do is define the table and the
    value-lists it needs.
    This is a wonderful tool for me in a Social Sciences
    department where the Professors are always designing surveys to
    gather data. I can deplay a web-based survey in a few hours, and,
    with your help and many hours poring over manuals, I have the first
    example working in ColdFusion. And, incidentally, the ColdFusion
    version is way tidier, more compact, and more readable than the ASP
    version.
    Dan, I'll be happy to answer other peoples' questions as soon
    as I am more confident in my knowlege of ColdFusion!
    -Richard
    Richard Hopley
    Research Associate
    Department of Social Science and Health Policy
    Wake Forest University Medical School
    Winston-Salem, NC

  • Access to MDS from EXCEL only via IP Adress (no DNS)

    Hi,
    I set up MDS and it is working proper - IE access works with DNS name as well as server name to access.
    When I use EXCEL to access only IP adress works - DNS or servern name throw an error:
    The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was 'Negotiate oXQwcqADCgEBomsEaWBnBgkqhkiG9xIBAgIDAH5YMFagAwIBBaEDAgEepBEYDzIwMTQwMjI1MTE0NDU0WqUFAgMCMLmmAwIBKakTGxFFVVJPUEUuTVlQVU1BLk5FVKoWMBSgAwIBAaENMAsbCWhlcmFzMzI2JA=='.
    ADDITIONAL INFORMATION:
    The remote server returned an error: (401) Unauthorized. (System)
    The target principal name is incorrect (System)
    BUT as I wrote: I can access via IE. MDS Services and MDS database are on separate servers. There is no entry (like "Anonymous") in security logs at the servers (I first thought about a Kerberos thing).
    Thanks, Wolfgang

    I did the same and it made no difference. And it was my understanding that turning on windows authentication causes issues with MDS. When I enable it with kernel mode turned off, it says HTTP request is unauthorized with client authentication scheme 'Negotiate'...The
    remote server returned an error...
    Gary Melhaff, DW Architect, MCTS SqlServer 2008 BI, Developer

  • Function module import parameter....Urgent

    Hi Experts,
    I am using User Exit M06E0004 which is using <b>FM EXIT_SAPLEBND_002</b>. It has 4 inport parameters
    I_CEKKO             LIKE CEKKO          
    IT_BEKPO            TYPE MMPUR_BEKPO    
    IT_BEKET            TYPE MMPUR_BEKET    
    IT_EKKNU            TYPE MMPUR_EKKNU    
    and 1 export paramenter E_CEKKO      LIKE      CEKKO
    I want to pass 1 more field MDSB-matnr(character type matnr for BOM child Items) which is not in any the structure  here.
    Its a standard FM so we have 1 include for enhancement in this exit. So what to do to get values for this. i need this matnr against a PO in CEKKO.
    I need to do all this for my requirement of IDOC. I have to send IDOC when any subcontract PO release and having Child Items(BOM materials MDSB-matnr) started with 'P'.
    Regards,
    Nik

    >>>
    <i>the requirement is,
    I have to send a customized IDOC to external application when a PO release. For sending IDOC automaticaly when PO release, I fount User exit M06E0004.</i>
    <<<
    OK.
    I take you did verify that this user exit is only triggered when you release the PO. Just asking because it's purpose, as it was said, is to influence the release strategy determination. This determination may happen when the PO is saved, not when the PO is actually released. In that case, this would be too early. But I'm not certain about the exact processing time, to be honest.
    If you determined that this is the right place, then it's all good.
    >>>
    <i>And IT_BEKPO, IT_BEKET are not internal tables , they are import parameters of table type MMPUR_BEKPO and MMPUR_BEKET.</i>
    <<<
    And what type do you think IT_BEKPO, etc. will be? Since they are defined with reference to a table type, they sure will be internal tables.
    If you want to read the content, you'd do something like this:
    DATA: W_BEKPO TYPE BEKPO.
    LOOP AT IT_BEKPO INTO W_BEKPO WHERE... <conditions>
      MOVE W_BEKPO-MENGE TO ...
      ...etc.
    ENDLOOP.
    As for reading MDSB, I don't know what your selection criterion is, but since MDSB is a view defined for table RESB, it only makes sense to use it if you do know the corresponding reservation number, item etc.
    You mentioned MATNR as the field you'd need from MDSB. Why? If you need the material number, it's readily available in IT_BEKPO. If you need reservation data in your IDoc then you'd read RESB with a proper indexed access (so for instance, with the material number from the PO item or something)...
    Regarding the whole 'sending IDoc when the PO is released' requirement, I'd probably try a different approach. My way of doing this would probably be to try to set up the regular message control with a specific output type generating the custom IDoc, and in the message determination I'd set a requirement that checks whether the PO is released... something like that.

  • How do I use a netgear N600 router with Infinity 1

    I have searched various forums etc. with mixed success so am hoping that someone here can give me an idiot's guide to connecting to the internet using my netgear N600 router rather than using the BT Homehub 5. BT say that I can do it (despite my router being set up for ADSL and the HH5 being set up for VDSL) but that they can't tell me how! They sent me an email with various details I would need but I can't see where most of them need to be added when I connect to the netgear set up wizard. What I could see I filled in but when I tried to connect the netgear genie told me the ADSL cable wasn't connected. Can anyone give me a step by step guide of what to do please? I would be very grateful. Thanks 

    nicolawatt wrote:
    I just have the homehub 5 - I have seen various complicated descriptions elsewhere explaining how to use the HH5 as just a modem or how to just connect directly with the Netgear but all have been a bit over my head!
    The HH5 cannot be used as a stand alone modem. You could use the Netgear as a simple wireless access point, but you would lose most of the functions, and would be better off using a proper wireless access point.
    You cannot use the Netgear as a router, without a modem.
    There are some useful help pages here, for BT Broadband customers only, on my personal website.
    BT Broadband customers - help with broadband, WiFi, networking, e-mail and phones.

  • Unable to digitally sign

    I have a form created that multiple people go in and sign, but one person in particular always gets the message "The file may be read-only, or another user may have it open.  Please......."  I know what that usually means but in this case there's no one in the file at the time.  I've even had everyone that has access to this file shut down Adobe completely in case it was locked by the program without the file being open.
    Anyone ever seen this before or know what to do to fix it?
    It will let him sign but never save!  He has the proper directory access, and was able to sign in the past.

    If the user copies the file to their local machine, are they able to sign and save the form?   If the order that your users sign the form is changed, can the user experiencing the problem sign the form?
    I don't believe this issue is related to the signatures, I think it's specific to the fact that the file is accessed from a shared drive, something seems to be keeping the file open. 
    Regards
    Steve

  • Problems with Swedish characters in maps on n95

    I upgraded my n95 to the latest firmware, 12.0.0.013 and after that my swedish map shows garbled road and city names, i.e Korsnäsvägen is displayed ad Korsnäsvägen. It looks like an international character issue. I also lost my navigation subscription after the upgrade and cant find any info on how to get it back. I've reinstalled the latest Nokia maps app and redownloaded the swedish map several times without any improvement

    09-Jul-200712:35 PM
    tordolsson wrote:
    Yes, I've reloaded the voice commands
    Hi tordolsson
    1. Start Maps application.
    2. Go to "Options > Extra services"
    3. Select "Add navigation > Accept > Purchase > Select the correct region" (I.e. the region you have earlier purchased the navigation to).
    4. You see a list of licenses with different lengths of time. You don't need to select the correct length, just go directly to "Options > Update".
    5. Allow connection to license server to check purchase & license options by selecting "Yes" and by selecting proper Internet access point (if asked).
    6. A note "xxx-day license activated" is shown where xxx is the amount of days left of your license.
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • How can I upload a folder?

    I'm searching for a way to upload a folder and its subfolders?
    The user selects a folder in a "File Browse"-item and the submit process should load the folder and its files and subfolders in the database. I know it isn't possible with Apex, but perhaps somebody has an idea!

    Rumburak,
    This is not impossible but could be somewhat tricky. You can load any file from a file
    system into your database table. First of all, you have to know the file names of the files
    you want to "convert" from BFILE to BLOB. You would need to scan the conntent of a
    directory first and store that information of your files in a collection or a table. Then, you
    would need to pick them one by one and store them in a blob. Sounds easy. However,
    there could be also problems having files stored on remote machines while needing to set
    up proper OS access rights. Allegedly, Unix shouldn't be a problem but on Windows, you
    need at least the version 10.1.0.5 of the database. You for sure will need to use java stored
    procedures since PL/SQL alone is not going to do the work.
    Denes Kubicek

  • How to download oracle linux 6 packages ?

    hi,
    my system have no access to the internet. How do i download the packages ?
    compat-libcap1-1.10
    compat-libstdc++-33-3.2.3

    Moderator Action:
    This thread is locked.
    It is the same question you asked in your other (active) thread:
    https://community.oracle.com/thread/2621118
    Multiple postings of an inquiry will only fragment information and it will quickly get lost.
    As for how to get files?
    You use a computer that has the proper outside access, then you copy the downloads to transportable media such as a CDR or DVD-R disk, then you move the files to the system where you eventually need them.

  • How to create a new Business Unit

    Hello,
    I have problem.
    Can anyone tell me
    1 : How to create a new Business Unit, New Company from Jd Edwards screen means webpage.
    2 : Can i find the User Defined Codes means UDC in jd edwards screen.
    Thanks,
    Shakti Prasad Priyakumar.

    First, let me confirm that you are on JDE World, and not JDE Enterprise One/One World. They are very different environments. JDE World is normally a green screen, IBM Client Access based system.
    If you are on a JDE World menu and you have the proper security access, just type in UDC on the command line and hit <ENTER>. You hopefully are in a test environment when you do this, since it sounds like you have very little knowledge of JDE. The UDC screen will come up. If you know the system code and code of the UDC table you want to look at, you can key them in and bring up that table. Otherwise, do F5. That will let you search by system code and see what table codes are available in each system. If you are not sure what UDC table you need, you can look at the JDE data dictionary for the data item you are interested in and that will tell you the UDC table, if the data item is UDC based.
    As for setting up new business units and company, get to the main general ledger menu. Don't remember the exact path, but you want to get into the setup/define menu for general ledger accounts. There will be separate options there for maintaining companies and for maintaining business units. You want to play with this in a test environment before you do anything for real.
    Hope this helps a bit.
    John Dickey

  • Office 2007 Documents Keep asking for credentials

    Hi All Gurus - Is there any issue with SP 2013 and Office 2007? We are trying to access office documents using IE 11, it prompts for credentials first time after compture reboot. Once given credentials it works fine whole day. but users who reboot there
    computer have to provide credentials next day. It's not with the PDF documents. Also, we have set proper Alternate Access Mapping and FQDN for the site. Also, the intranet site has been added to the trusted site. Also, tried with the Local Intranet Zone setting
    "Automatic logon with current username and password".  
    Users with the IE 10/11 and Office 2010 have no issues.
    Could anybody please guide me on this?
    Regards,
    Khushi

    try these links:
    http://blogs.technet.com/b/office_integration__sharepoint/archive/2014/02/24/users-are-prompted-for-username-and-password-when-opening-an-office-file-from-a-web-server.aspx
    http://www.mysharepointadventures.com/2012/02/sharepoint-keeps-prompting-for-credentials/
    http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/MS-SharePoint/Q_27955868.html
    http://stackoverflow.com/questions/375390/office-documents-prompt-for-login-in-anonymous-sharepoint-site
    also you can try to disableloopbackcheck as below link:
    http://blogs.technet.com/b/sharepoint_foxhole/archive/2010/06/21/disableloopbackcheck-lets-do-it-the-right-way.aspx
    http://www.jeremytaylor.net/2010/05/24/sharepoint-disable-loopback-check-disableloopbackcheck-dword-in-registry/
    also try tocheck if compatibility issues is present between sharepoint 2013 and office2007 docs.
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • Upgrade impact on ALE, IDOC, RFC & XI

    Hi all
    We are having SAP R/3 4.6c and planning to upgrade ECC 6.0. Please tell me what are impacts on ALE, IDOC, RFC & XI integrations.
    Thanks in Advance.
    Raju

    During Upgrade...
    ALE : ALE Customer Distribution Model ajustments due to changes in underlying structures and fields in Idoc Segments
    We need to adjust the CDM as to adopt these to new ECC6.0 enviroment.
    IDOC : Many of the new IDOCS are not released by SAP hence it happens that these IDOCs get stucked in ALE Communication layer and hence we need to see that IDOC's in use or to be used are released by SAP.
    SAP supports these release issues ...
    Also check the Message Control Settings which needs to be checked and verified during upgrade..
    Interface Mappings : - IDOC to Non SAP systems..Proper rights access should be checked...
    Authorisations, Access rights for Directories ...
    These are the main areas which you should look upon and rest of the things will be known to you once your Business Process testing will start
    Thanks and Regards
    Pushkar Joshi

  • Select from multiple entries in table cell.

    Hi All,
    I'm having issues when trying to do a simple select from an access database:
    <CFQUERY NAME="GetAllByMonth" DATASOURCE="dsn">
    SELECT * FROM table WHERE  strMonth = '#url.strMonth#' AND strDisplay = Yes
    order by strOrder_id
    </CFQUERY>
    Table cells in rows contain coma separated values:
    January, February, March, April, May, June, October, November, December
    Unfortunately the query returns no values. I've tried changing the "=" with "like", "contains" but with no results.
    Difficult to know what to search for so any help gratefully recieved.
    Ta
    Trevor

    Here is an absolutely crazy "hack" that I once used when dealing with a database like that.  It had hundreds of thousands of rows with comma separated values that for various legacy could not be changed.
    So one day I did this ...  SELECT DISTINCT column_from_purgatory FROM table_from_hell.
    Much to my surprise, there were less than a hundred DISTINCT values in that column.  (They were, fortunately, reasonably-sized VARCHARs.)
    So I built a table of those values, then created a separate table into which I could put each of the comma-separated parts, and then wrote a small (Perl) script to populate the two.  For example, a row containing "January, March, April" would be linked to three rows containing one month-name each.
    Now, as long as I had a way to be sure that this pair of lookup-tables was always complete (which was slightly problematic), I had something that I could actually JOIN to.  It wasn't pretty ... in fact, it was butt-ugly ... but it saved a tremendous amount of processing time for this application.

Maybe you are looking for

  • After Restoring iPod

    I restored my iPod, which by the way I bought last week, it displayed connect to power adapter icon on screen. I connected and it has been connected since 2p.m. in the afternoon and now it is 11p.m. at night and all it is showing me is the same icon

  • Wireless downloads slower with BT Infinity

    I recently upgraded from BT Broadband (ADSL2+ with BT Home Hub 1.0) to BT Infinity. I installed and switched over to the new BT Home Hub 3 before the BT Openreach engineer came, as I was worried about how wireless networking would work as the Hub had

  • Command lines for compiling forms

    Hi all, I want to know if there are command lines producing the actions equivalent of Maj+Ctrl+K and Ctrl+T when we are working with a form. Thank you very much indeed.

  • Query for local admins

    What is the query for finding out who all has local admin access on there workstations?

  • Put Razor-Qt in the official repository.

    Hi, Razor-Qt has well released the 0.4 version which(I think!) is quite stable. To keep up this razor-edge, I think, razor-qt should be pushed into the official repositories. Its' much cooler and lighter window manager all in Qt. Thanks.