<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Simon Whatley &#187; firewall</title>
	<atom:link href="http://www.simonwhatley.co.uk/tag/firewall/feed" rel="self" type="application/rss+xml" />
	<link>http://www.simonwhatley.co.uk</link>
	<description>The opposite of every great idea is another great idea</description>
	<lastBuildDate>Wed, 02 Nov 2011 09:28:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Secure Your Application &#8211; PCI DSS Specifications</title>
		<link>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications</link>
		<comments>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications#comments</comments>
		<pubDate>Mon, 26 Jan 2009 11:19:37 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Adobe ColdFusion]]></category>
		<category><![CDATA[American Express]]></category>
		<category><![CDATA[anti-virus software]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[architecture]]></category>
		<category><![CDATA[Authentication]]></category>
		<category><![CDATA[BlueDragon]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[company processing]]></category>
		<category><![CDATA[compliance]]></category>
		<category><![CDATA[control measures]]></category>
		<category><![CDATA[Data Security Standard]]></category>
		<category><![CDATA[database server]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Discover Financial Services]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JCB International]]></category>
		<category><![CDATA[Manitoba]]></category>
		<category><![CDATA[Mastercard Worldwide]]></category>
		<category><![CDATA[Payment Card Industry]]></category>
		<category><![CDATA[Payment Card Industry Security Standards Council]]></category>
		<category><![CDATA[payment card processing]]></category>
		<category><![CDATA[Payment Processors]]></category>
		<category><![CDATA[PCI DSS]]></category>
		<category><![CDATA[public networks]]></category>
		<category><![CDATA[Railo]]></category>
		<category><![CDATA[raw processing]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[regulations]]></category>
		<category><![CDATA[secure]]></category>
		<category><![CDATA[secure systems]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[Security Standards Council]]></category>
		<category><![CDATA[security systems]]></category>
		<category><![CDATA[Server Side]]></category>
		<category><![CDATA[software developers]]></category>
		<category><![CDATA[software releases]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SSC]]></category>
		<category><![CDATA[the Council]]></category>
		<category><![CDATA[Visa]]></category>
		<category><![CDATA[Visa Inc .]]></category>
		<category><![CDATA[web application]]></category>
		<category><![CDATA[web application developers]]></category>
		<category><![CDATA[web applications]]></category>
		<category><![CDATA[web code]]></category>
		<category><![CDATA[Web Servers]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=1785</guid>
		<description><![CDATA[PCI DSS stands for Payment Card Industry Data Security Standard, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (PCI SSC). The PCI security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be PCI DSS compliant.]]></description>
			<content:encoded><![CDATA[<p>PCI DSS stands for <a href="https://www.pcisecuritystandards.org/" title="Payment Card Industry Data Security Standard website" target="_blank" rel="nofollow">Payment Card Industry Data Security Standard</a>, and is a worldwide security standard assembled by the Payment Card Industry Security Standards Council (<abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr>). The <abbr title="Payment Card Industry">PCI</abbr> security standards are technical and operational requirements that were created to help organizations that process card payments prevent credit card fraud, hacking and various other security vulnerabilities and threats. The standards apply to all organizations that store, process or transmit cardholder data – with guidance for software developers and manufacturers of applications and devices used in those transactions. A company processing, storing, or transmitting cardholder data must be <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> compliant.</p>
<p><a href="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png"><img src="http://www.simonwhatley.co.uk/blog/wp-content/uploads/2009/01/payment-card-data.png" alt="Types of Data on a Payment Card" title="Types of Data on a Payment Card" width="600" height="255" class="aligncenter size-full wp-image-1815" /></a></p>
<p>The <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> (<q>Council</q>) is responsible for managing the security standards, while compliance with the <abbr title="Payment Card Industry">PCI</abbr> set of standards is enforced by the founding members of the Council: <a href="http://www.americanexpress.com/datasecurity" title="American Express" target="_blank" rel="nofollow">American Express</a>, <a href="http://www.discovernetwork.com/fraudsecurity/disc.html" title="Discover Financial Services" target="_blank" rel="nofollow">Discover Financial Services</a>, <a href="http://www.jcb-global.com/english/pci/index.html" title="JCB International" target="_blank" rel="nofollow">JCB International</a>, <a href="http://www.mastercard.com/sdp" title="MasterCard Worldwide" target="_blank" rel="nofollow">MasterCard Worldwide</a> and <a href="http://www.visa.com/cisp" title="Visa" target="_blank" rel="nofollow">Visa Inc</a>. Non-compliant companies who maintain a relationship with one or more of the card brands, either directly or through an acquirer risk losing their ability to process credit card payments and being audited and/or fined.</p>
<p>All in-scope companies must validate their compliance annually. This validation can be conducted by Qualified Security Assessors, i.e. companies that have completed a <a href="https://www.pcisecuritystandards.org/qsa_asv/become_qsa.shtml" title="PCI: Becoming a Qualified Security Assessor" target="_blank" rel="nofollow">three-step certification process</a> by the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Security Standards Council">SSC</abbr> which recognises them as being qualified to assess compliance to the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standard">DSS</abbr> standard. However, smaller companies have the option to use a <a href="https://www.pcisecuritystandards.org/saq/index.shtml" title="PCI Self-Assessment Questionnaire" target="_blank" rel="nofollow">Self-Assessment Questionnaire</a>. Whether this questionnaire needs to be validated by a <abbr title="Qualified Security Assessors">QSA</abbr> depends on the requirements of the card brands in that merchant&#8217;s region.</p>
<p>The current version of the standard specifies 12 requirements for compliance, organised into 6 logically related groups, which are called &#8220;control objectives.&#8221;</p>
<ol>
<li>Build and Maintain a Secure Network
<ul>
<li>Requirement 1: Install and maintain a firewall configuration to protect cardholder data</li>
<li>Requirement 2: Do not use vendor-supplied defaults for system passwords and other security parameters</li>
</ul>
</li>
<li>Protect Cardholder Data
<ul>
<li>Requirement 3: Protect stored cardholder data</li>
<li>Requirement 4: Encrypt transmission of cardholder data across open, public networks</li>
</ul>
</li>
<li>Maintain a Vulnerability Management Program
<ul>
<li>Requirement 5: Use and regularly update anti-virus software</li>
<li>Requirement 6: Develop and maintain secure systems and applications</li>
</ul>
</li>
<li>Implement Strong Access Control Measures
<ul>
<li>Requirement 7: Restrict access to cardholder data by business need-to-know</li>
<li>Requirement 8: Assign a unique ID to each person with computer access</li>
<li>Requirement 9: Restrict physical access to cardholder data</li>
</ul>
</li>
<li>Regularly Monitor and Test Networks
<ul>
<li>Requirement 10: Track and monitor all access to network resources and cardholder data</li>
<li>Requirement 11: Regularly test security systems and processes</li>
</ul>
</li>
<li>Maintain an Information Security Policy
<ul>
<li>Requirement 12: Maintain a policy that addresses information security</li>
</ul>
</li>
</ol>
<p>Compliance with these requirements can be summarized into 3 main stages:</p>
<ul>
<li>Collecting and storing: Secure collection and tamper-proof storage of all log data so that it is available for analysis.</li>
<li>Reporting: Being able to prove compliance on the spot if audited and present evidence that controls are in place for protecting data.</li>
<li>Monitoring and alerting: Have systems in place such as auto-alerting, to help administrators constantly monitor access and usage of data. Administrators are warned of problems immediately and can rapidly address them. These systems should also extend to the log data itself –- there must be proof that log data is being collected and stored.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>What does this actually mean for web application developers?</h3>
<p>It is considerably more expensive and more time-consuming to recover from a security incident than to take preventative measures ahead of time. If you follow the guidelines below, you will go along way to securing you application in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations. Many of the measures apply to general application security, but since <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> is all about security, they are worth mentioning.</p>
<p>Server-level Security:</p>
<ul>
<li>Separate web- and database-servers on to different physical machines.</li>
<li>Secure the web- and database-servers with traditional techniques. Only authorised accounts should have the capabilities to run tasks on the machine. That means not giving admin-rights to the user account.</li>
<li>Keep servers up-to-date with the latest patches and software releases.</li>
<li>Minimise the number of services running on the server. This means limiting the services to only those required for the web- or database-servers to function.</li>
<li>Secure information in transit between servers. This may mean physically securing the network to prevent evesdropping via encryption or obfuscating the data amongst innocuous &#8216;noise&#8217;.</li>
<li>Secure the database server behind a firewall.</li>
</ul>
<p>Application-level Security:</p>
<ul>
<li>Separate ColdFusion, the webserver and database server user accounts. They should never be under the same system account.</li>
<li>Create a database user specifically for your ColdFusion datasource and restrict it to only the activities required for the application. The user should not have database-owner rights, access to databases not relating to the application or access to the system tables.</li>
<li>Revoke privileges in the ColdFusion datasource definition to prevent the <abbr title="Structured Query Language">SQL</abbr> commands <code>CREATE</code>, <code>DROP</code>, <code>GRANT</code>, <code>REVOKE</code> and <code>ALTER</code>.</li>
<li>General settings in the ColdFusion Administrator:
<ul>
<li>Check the <em>Disable access to internal ColdFusion Java components</em> option.</li>
<li>Check the <em>Enable Global Script Protection</em> option.</li>
<li>Add a <em>Missing Template Handler</em>.</li>
<li>Add a <em>Site-wide Error Handler</em>.</li>
<li>Reduce the <em>Maximum size of post data</em> from 100<abbr title="megabytes">MB</abbr>.</li>
<li>Enable <em>Timeout Requests</em>, and set to 60 seconds or less.</li>
<li>Disable <em>Robust Exception Handling</em> on production servers.</li>
</ul>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Web Application-level Security:</p>
<ul>
<li>Use secure HTTP to transfer data and/or when logged into &#8216;administration&#8217; secutions of your web application.</li>
<li>Timeout sessions after 15 minutes and on browser close.</li>
<li>Provide multi-level login processes. For example, lock the application after 3 failed attempts for a period of 10 minutes.</li>
<li>Do not identify whether the username or password are incorrect, simply notify the user that their login failed and that they must try again.</li>
<li>Encrypt passwords stored in the database with a standard such as <a href="http://en.wikipedia.org/wiki/SHA_hash_functions" title="Wikipedia: SHA cryptographic has function" target="_blank" rel="nofollow">SHA-256</a> or &#8216;stronger&#8217;.</li>
<li>Use <a href="http://en.wikipedia.org/wiki/Captcha" title="Wikipedia: CAPTCHA" target="_blank" rel="nofollow">CAPTCHA</a>s (textual and aural) to prevent automated robots hacking into your application.</li>
<li>Run regular penetration tests on your application to identify potential problems.</li>
<li>Encrypt credit card information held in the database or other storage mechanism. Only store credit card data in line with the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> regulations.</li>
</ul>
<p>Code-level Security:</p>
<ul>
<li>Application.cfc &#8211; Set the <code>scriptProtect</code> Application variable to <code>true</code> to enable application-wide cross-site script protection.
</li>
<li>CFQueryParam &#8211; This tag, importantly, verifies the data type of a query parameter and, for <abbr title="Relational Database Management Systems">RDBMS</abbr>s that support bind variables, enables ColdFusion to use bind variables in the <acronym title="Structured Query Language">SQL</acronym> statement. Bind variable usage enhances performance when executing a <code>cfquery</code> statement multiple times. There are limitations to the use of the <code>cfqueryparam</code> tag. In ColdFusion 7 for example, you cannot use them in queries using the <code>cachedWithin</code> attribute. Similarly, they cannot be used in <code>ORDER BY</code> clauses, although the use of conditional logic should resolve the need for order by variables.
</li>
<li>Functions &#8211; As a rule of thumb, validate <em>all</em> the data being passed into a query prior to it being used. ColdFusion MX 7 saw the introduction of the <code>isValid()</code> function. This function tests whether a value meets a validation or data type rule and can be used to replace a large number of type-specific functions such as <code>isArray()</code>, <code>isBinary()</code>, <code>isBoolean()</code>, <code>isDate()</code>, <code>isNumeric()</code> and <code>isSimpleValue()</code> etc.
</li>
<li>Stored Procedures &#8211; I often favour the use of stored procedures over standard queries. Not only do they add an additional level of performance, they provide an additional level of security; ColdFusion does not do any raw processing of queries in the web code, it simply passes variables down the wire to the database server.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Conclusion</h3>
<p>The goal of the <abbr title="Payment Card Industry">PCI</abbr> Data Security Standard is to protect cardholder data that is processed, stored or transmitted by merchants. The security controls and processes required by <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> are vital for protecting cardholder account data, including the <abbr title="primary account number">PAN</abbr> &#8211; the primary account number printed on the front of a payment card. Merchants and any other service providers involved with payment card processing must never store sensitive authentication data after authorisation. This includes sensitive data that is printed on a card, or stored on a card’s magnetic stripe or chip &#8211; and personal identification numbers entered by the cardholder.</p>
<p>By following the points made above, you will go a long way to meeting the <abbr title="Payment Card Industry">PCI</abbr> <abbr title="Data Security Standards">DSS</abbr> guidelines, whilst also securing your infrastructure and applications in a more general sense.</p>
<p><strong>Caveat:</strong> The views and comments written in this article are provided as a guideline. I hold no responsibility for the security of your applications and data based upon the information provided.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/secure-your-application-pci-dss-specifications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Protect Your Website from a Malicious Attack</title>
		<link>http://www.simonwhatley.co.uk/how-to-protect-your-website-from-a-malicious-attack</link>
		<comments>http://www.simonwhatley.co.uk/how-to-protect-your-website-from-a-malicious-attack#comments</comments>
		<pubDate>Mon, 18 Aug 2008 12:54:20 +0000</pubDate>
		<dc:creator>Simon</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Application.cfc]]></category>
		<category><![CDATA[Application.cfm]]></category>
		<category><![CDATA[attack]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[cfquery]]></category>
		<category><![CDATA[cfqueryparam]]></category>
		<category><![CDATA[ColdFusion]]></category>
		<category><![CDATA[ColdFusion Administrator]]></category>
		<category><![CDATA[cross-site scripting]]></category>
		<category><![CDATA[database server]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Manitoba]]></category>
		<category><![CDATA[Mark Kruger]]></category>
		<category><![CDATA[prevention]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[raw processing]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[script protect]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[software releases]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[SQL Injection]]></category>
		<category><![CDATA[url]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[vulnerability]]></category>
		<category><![CDATA[Web Application Hacker]]></category>
		<category><![CDATA[web code]]></category>
		<category><![CDATA[Web Security]]></category>
		<category><![CDATA[Web Server]]></category>
		<category><![CDATA[Web Servers]]></category>
		<category><![CDATA[webserver]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://www.simonwhatley.co.uk/?p=809</guid>
		<description><![CDATA[Every seasoned developer will know that protecting your website from a hacker is a top priority, whether for your own reputation or for maintaining your company's reputation and log-term revenue prospects.]]></description>
			<content:encoded><![CDATA[<p>Every seasoned developer will know that protecting your website from a hacker is a top priority, whether for your own reputation or for maintaining your company&#8217;s reputation and log-term revenue prospects.</p>
<p><strong>Why should you be worried about security?</strong></p>
<p>The Web is changing many of the assumptions that people have historically made about computer security and publishing. As the Internet makes it possible for web servers to publish information to millions of users, it also makes it possible for computer hackers, crackers, criminals, vandals, and other &#8220;bad guys&#8221; to break into the very computers on which the web servers are running. Once subverted, web servers can be used by attackers as a launching point for conducting further attacks against users and organisations.</p>
<p>It is considerably more expensive and more time-consuming to recover from a security incident than to take preventative measures ahead of time.</p>
<p>This blog post started on the premise of protecting your website from a <a href="http://en.wikipedia.org/wiki/SQL_injection" title="Wikipedia: SQL Injection" target="_blank" rel="nofollow">SQL Injection</a> Attack. However, it is also appropriate to discuss, at a relatively high level, how to secure your server architecture and applications.</p>
<h3>Server-Level Security</h3>
<ul>
<li>Separate web- and database-servers on to different physical machines.</li>
<li>Secure the web- and database-servers with traditional techniques. Only authorised accounts should have the capabilities to run tasks on the machine. That means not giving admin-rights to the user account.</li>
<li>Keep servers up-to-date with the latest patches and software releases.</li>
<li>Minimise the number of services running on the server. This means limiting the services to only those required for the web- or database-servers to function.</li>
<li>Secure information in transit between servers. This may mean physically securing the network to prevent evesdropping via encryption or obfuscating the data amongst innocuous &#8216;noise&#8217;.</li>
<li>Secure the database server behind a firewall.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h3>Application-Level Security</h3>
<ul>
<li>Separate ColdFusion, the webserver and database server user accounts. They should never be under the same system account.</li>
<li>Create a database user specifically for your ColdFusion datasource and restrict it to only the activities required for the application. The user should not have database-owner rights, access to databases not relating to the application or access to the system tables.</li>
<li>Revoke privileges in the ColdFusion datasource definition to prevent the SQL commands <code>CREATE</code>, <code>DROP</code>, <code>GRANT</code>, <code>REVOKE</code> and <code>ALTER</code>.</li>
<li>General settings in the ColdFusion Administrator:
<ul>
<li>Check the <em>Disable access to internal ColdFusion Java components</em> option.</li>
<li>Check the <em>Enable Global Script Protection</em> option.</li>
<li>Add a <em>Missing Template Handler</em>.</li>
<li>Add a <em>Site-wide Error Handler</em>.</li>
<li>Reduce the <em>Maximum size of post data</em> from 100<abbr title="megabytes">MB</abbr>.</li>
<li>Enable <em>Timeout Requests</em>, and set to 60 seconds or less.</li>
<li>Disable <em>Robust Exception Handling</em> on production servers.</li>
</ul>
</li>
</ul>
<h3>Code-Level Security</h3>
<ul>
<li>Application.cfc &#8211; Set the <code>scriptProtect</code> Application variable to <code>true</code> to enable application-wide cross-site script protection.
</li>
<li>CFQueryParam &#8211; This tag, importantly, verifies the data type of a query parameter and, for <abbr title="Relational Database Management Systems">RDBMS</abbr>s that support bind variables, enables ColdFusion to use bind variables in the <acronym title="Structured Query Language">SQL</acronym> statement. Bind variable usage enhances performance when executing a <code>cfquery</code> statement multiple times.

<div class="wp_syntax"><div class="code"><pre class="cfm" style="font-family:monospace;"><span style="color: #333333;"><span style="color: #800000;">&lt;cfquery</span> <span style="color: #0000ff;">name</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;qry&quot;</span> <span style="color: #0000ff">datasource</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#APPLICATION.dsn#&quot;</span><span style="color: #800000;">&gt;</span></span>
SELECT column1, column2, column3
FROM tableName
WHERE column4 = <span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#variable1#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_bit&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
AND column5 LIKE <span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;%#variable2#%&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_varchar&quot;</span> <span style="color: #0000ff;">maxlength</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;200&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>
AND column6 IN (<span style="color: #333333;"><span style="color: #800000;">&lt;cfqueryparam</span> <span style="color: #0000ff;">value</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;#variable3#&quot;</span> <span style="color: #0000ff">cfsqltype</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;cf_sql_integer&quot;</span> <span style="color: #0000ff">list</span><span style="color: #0000ff;">=</span><span style="color: #009900;">&quot;true&quot;</span> <span style="color: #0000ff;">/</span><span style="color: #800000;">&gt;</span></span>)
<span style="color: #333333;"><span style="color: #800000;">&lt;/cfquery&gt;</span></span></pre></div></div>

<p>There are limitations to the use of the <code>cfqueryparam</code> tag. In ColdFusion 7 for example, you cannot use them in queries using the <code>cachedWithin</code> attribute. Similarly, they cannot be used in <code>ORDER BY</code> clauses, although the use of conditional logic should resolve the need for order by variables.
</li>
<li>Functions &#8211; As a rule of thumb, validate <em>all</em> the data being passed into a query prior to it being used. ColdFusion MX 7 saw the introduction of the <code>isValid()</code> function. This function tests whether a value meets a validation or data type rule and can be used to replace a large number of type-specific functions such as <code>isArray()</code>, <code>isBinary()</code>, <code>isBoolean()</code>, <code>isDate()</code>, <code>isNumeric()</code> and <code>isSimpleValue()</code> etc.
</li>
<li>Stored Procedures &#8211; I often favour the use of stored procedures over standard queries. Not only do they add an additional level of performance, they provide an additional level of security; ColdFusion does not do any raw processing of queries in the web code, it simply passes variables down the wire to the database server.</li>
</ul>
<h3>Additional Resources</h3>
<ul>
<li>
<a href="http://www.amazon.com/Web-Security-Privacy-Commerce-2nd/dp/0596000456/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1218663002&#038;sr=8-1" title="Amazon: Web Security, Privacy and Commerce" target="_blank" rel="nofollow">Web Security, Privacy and Commerce</a></li>
<li>O&#8217;Reilly&#8217;s <a href="http://www.amazon.com/Web-Application-Hackers-Handbook-Discovering/dp/0470170778/ref=pd_bbs_sr_1?ie=UTF8&#038;s=books&#038;qid=1218663073&#038;sr=1-1" title="Amazon: The Web Application Hacker's Handbook" target="_blank" rel="nofollow">The Web Application Hacker&#8217;s Handbook</a></li>
<li>Adobe&#8217;s whitepaper &#8211; <a href="http://www.adobe.com/devnet/coldfusion/articles/dev_security/coldfusion_security_cf8.pdf" title="Adobe: ColdFusion 8 Security PDF" target="_blank" rel="nofollow">ColdFusion 8 Developer Security Guidlines</a> (<abbr title="Portable Document Format">PDF</abbr>, 281k)</li>
<li>Adobe&#8217;s whitepaper &#8211; <a href="http://www.adobe.com/devnet/coldfusion/articles/dev_security/coldfusion_security_cf7.pdf" title="Adobe: ColdFusion 7 Security PDF" target="_blank" rel="nofollow">ColdFusion 7 Developer Security Guidlines</a> (<abbr title="Portable Document Format">PDF</abbr>, 217k)</li>
<li>Adobe DevNet &#8211; <a href="http://www.adobe.com/devnet/coldfusion/articles/stored_procs.html" title="Learning Stored Procedure Basics in ColdFusion 8" target="_blank" rel="nofollow">Learning Stored Procedure Basics in ColdFusion 8</a></li>
<li>0&#215;000000 # The Hacker Webzine&#8217;s article on <a href="http://www.0x000000.com/?i=610" title="The Hacker Webzine: Attacking ColdFusion" target="_blank" rel="nofollow">Attacking ColdFusion</a></li>
<li>Three part series from Mark Kruger (ColdFusion Muse) &#8211; <a title="Query String with cfqueryparam" href="http://www.coldfusionmuse.com/index.cfm/2008/7/21/query-string-with-cfqueryparam" target="_blank" rel="nofollow">Part 1</a>, <a title="Using CAST and ASCII" href="http://www.coldfusionmuse.com/index.cfm/2008/7/18/Injection-Using-CAST-And-ASCII" target="_blank" rel="nofollow">Part 2</a>, <a title="Using Order By" href="http://www.coldfusionmuse.com/index.cfm/2008/7/21/SQL-injection-using-order-by" target="_blank" rel="nofollow">Part 3</a></li>
<li>Brad Wood&#8217;s article on <a href="http://www.codersrevolution.com/index.cfm/2008/7/26/cfqueryparam-its-not-just-for-security-also-when-NOT-to-use-it" title="CFQueryParam is not just for security - When not to use it" target="_blank" rel="nofollow">CFQueryParam is not just for security</a>.</li>
</ul>
<p><script type="text/javascript"><!--
google_ad_client = "pub-6475233631580417";
/* 468x60 Basic */
google_ad_slot = "7117418273";
google_ad_width = 468;
google_ad_height = 60;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.simonwhatley.co.uk/how-to-protect-your-website-from-a-malicious-attack/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

