27.01.2014 Views

NIST 800-44 Version 2 Guidelines on Securing Public Web Servers

NIST 800-44 Version 2 Guidelines on Securing Public Web Servers

NIST 800-44 Version 2 Guidelines on Securing Public Web Servers

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GUIDELINES ON SECURING PUBLIC WEB SERVERS<br />

language, and it is widely used with the mySQL database [<str<strong>on</strong>g>NIST</str<strong>on</strong>g>01]. The following are some important<br />

points to c<strong>on</strong>sider when c<strong>on</strong>templating the deployment of PHP:<br />

The latest versi<strong>on</strong> of PHP available should be used because older versi<strong>on</strong>s have numerous security<br />

vulnerabilities.<br />

PHP provides a number of opti<strong>on</strong>s that simplify development; some of these opti<strong>on</strong>s (e.g., the<br />

register_globals opti<strong>on</strong>, which c<strong>on</strong>verts all input parameters into PHP variables and may override<br />

values in the PHP script) can make it more difficult for novices to develop secure programs.<br />

Much of the freely available third-party code for PHP is poorly written from a security perspective. 43<br />

6.4.3 Server-Side C<strong>on</strong>tent Generator Security C<strong>on</strong>siderati<strong>on</strong>s<br />

When examining or writing an active c<strong>on</strong>tent executable or script, c<strong>on</strong>sider the following:<br />

The executable code should be as simple as possible. The l<strong>on</strong>ger or more complex it is, the more<br />

likely it will have problems.<br />

The executable code’s ability to read and write programs should be limited. Code that reads files may<br />

inadvertently violate access restricti<strong>on</strong>s or pass sensitive system informati<strong>on</strong>. Code that writes files<br />

may modify or damage documents or introduce Trojan horses.<br />

The code’s interacti<strong>on</strong> with other programs or applicati<strong>on</strong>s should be analyzed to identify security<br />

vulnerabilities. For example, many CGI scripts send e-mails in resp<strong>on</strong>se to form input by opening up<br />

a c<strong>on</strong>necti<strong>on</strong> with the sendmail program. Ensure this interacti<strong>on</strong> is performed in a secure manner.<br />

On Linux/Unix hosts, the code should not run with suid (set-user-id).<br />

The code should use explicit path names when invoking external programs. Relying <strong>on</strong> the PATH<br />

envir<strong>on</strong>ment variable to resolve partial path names is not recommended.<br />

<strong>Web</strong> servers should be scanned periodically for vulnerabilities, even if they do not employ active<br />

c<strong>on</strong>tent (see Secti<strong>on</strong> 9.4.1). Network security scanners may detect vulnerabilities in the <strong>Web</strong> server,<br />

OS, or other services running <strong>on</strong> the <strong>Web</strong> server. <strong>Web</strong> applicati<strong>on</strong> vulnerability scanners specifically<br />

scan for c<strong>on</strong>tent generator vulnerabilities (see Appendix C for more informati<strong>on</strong>).<br />

<strong>Web</strong> c<strong>on</strong>tent generati<strong>on</strong> code should be scanned and/or audited (depending <strong>on</strong> the sensitivity of the<br />

<strong>Web</strong> server and its c<strong>on</strong>tent). Commercially available tools can scan .NET or Java code. A number of<br />

commercial entities offer code review services.<br />

<strong>Web</strong> c<strong>on</strong>tent generati<strong>on</strong> code should be developed following current recommended practices. <str<strong>on</strong>g>44</str<strong>on</strong>g><br />

For data entry forms, determine a list of expected characters and filter out unexpected characters from<br />

input data entered by a user before processing a form. For example, <strong>on</strong> most forms, expected data<br />

43<br />

<str<strong>on</strong>g>44</str<strong>on</strong>g><br />

There are a number of reas<strong>on</strong>s for the poor security of many PHP scripts. The most obvious is that many scripts are written<br />

without c<strong>on</strong>cern for security. In additi<strong>on</strong>, because of the relative ease of coding PHP scripts, many novices who have little<br />

knowledge of secure programming create and often freely distribute poorly written scripts.<br />

OWASP is compiling a guide c<strong>on</strong>taining <strong>Web</strong> applicati<strong>on</strong> development best practices <strong>on</strong> their site at<br />

http://www.owasp.org/index.php/OWASP_Guide_Project.<br />

6-15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!