Home > Software Quality News > Java secure, but developers introduce vulnerabilities, report finds
Software Quality News:
EMAIL THIS

Java secure, but developers introduce vulnerabilities, report finds

By Michelle Davidson, Site Editor
05 Mar 2007 | SearchSoftwareQuality.com

Software quality news and advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google

The use of Java and Java software packages is increasing, and although Java has been found to be more secure than other languages, researchers at Fortify Software warn that developers may inadvertently be introducing vulnerabilities into their own code.

In a report from its Java Open Review (JOR) Project, which analyzed four commonly used Java packages -- Spring, Struts, Hibernate and Tomcat -- Fortify confirms a commonly held belief that software components written in Java are, in general, more secure than components written in languages such as C or C++. The project's analysis found two bugs in Hibernate, four in Spring, eight in Struts and 66 in Tomcat. Altogether, the estimated defect density for every thousand lines of code is .07.

Fortify also said Java's reliability is due largely to two features of the language: type safety and memory safety. Because the Java compiler can enforce a stronger type safety policy, Java programmers find more of their own bugs when they compile their code. In addition, when Java programs run, the Java Virtual Machine ensures that fewer of the remaining bugs have catastrophic consequences.

The danger to Java programs, according to the report, comes from the sample code that's often included in these open source packages, as they are likely to contain vulnerabilities.

Secure Java development
Demystifying Java platform security -- Part 1

Demystifying Java platform security -- Part 2

XSS prevention in Java

"A lot of the open source packages are shipped with code samples, and those code samples are not written very safely," said Barmak Meftah, vice president of products and services at Fortify. "The first concern is that developers use that sample code as is and evolve it into applications. The second is that they use the samples for education and train themselves using insecure examples."

These code samples, Meftah said, are written inadvertently without security in mind. "A lot of developers also cut and paste the sample code, and that can result in bad things happening," he said.

The JOR report also revealed that while the packages themselves did not contain vulnerabilities, they did create situations that may lead programmers to write vulnerable code. For example, Hibernate contains a method named createSQLQuery() that accepts a single string parameter. Fortify says this interface promotes the introduction of SQL injection vulnerabilities by encouraging programmers to create SQL queries using string concatenation.

Joseph B. Ottinger, editor of TheServerSide.com, said generally the report is correct. "But they're overemphasizing the existence of a few methods that are not encouraged by the library vendors," he said. "And honestly, even the sample programs are described as not being best practices. For example, the createSQLQuery code is definitely not what Hibernate developers would normally suggest using, because Hibernate has much, much easier mechanisms for that purpose that are secure."

Ottinger did agree that a big problem is programmers creating their own code based on those samples without being aware of security issues. "The greatest danger is when someone creates their own library code based on these libraries and doesn't know what security holes there are to avoid," he said. "For example, again using that code, someone might create a utility library to make Hibernate queries ''easier' (by avoiding Hibernate's own query mechanisms) and therefore introducing bugs."

Use of Java, open source software rising
These insecure development practices are even greater due to the fact that the use of Java and open source software is increasing, Fortify researchers say. According to Google Directories, the total number of open source packages written in Java (3,469 packages) far exceeds any other language, and in fact, more than doubles the second most-used language, PHP (1,643 packages), and is used three times as often as C++ (929 packages).

"Use of open source application packages is on the rise, and security is a key concern for enterprise adoption and deployment," Dr. William Pugh, a professor at the University of Maryland who developed the FindBugs static analysis tool for Java, said in a statement. "What these scans [from Fortify] found and didn't find is important to understanding and improving the security of open source software."

Cross-site scripting vulnerabilities common
In the components examined for the JOR report, Fortify also found cross-site scripting (XSS) vulnerabilities more often than any other type of security issue. XSS vulnerabilities allow an attacker to run arbitrary JavaScript in a victim's Web browser, which can lead to theft of personal information, hijack of authentication credentials or attacks against computers on the victim's internal network.

XSS, the most frequently reported type of vulnerability for 2006 in the Common Vulnerabilities and Exposures (CVE) database, can be prevented by validating the input parameters at both client-side and server-side before accepting the request and resuming the process on input parameters. The best way to prevent such an attack, however, is to consider security when building an application.

"Make security an inherent part of the development life cycle," Meftah said. "The more upper management emphasizes security, the more important it will become in the development life cycle."



Tags: Software security testing and techniquesBuilding security into the SDLC (Software development life cycle)VIEW ALL TAGS

Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Software security testing and techniques
Web server weaknesses you don't want to overlook
Using firewalls for software testing: Pros and cons
Beating software's cross-site scripting, authentication problems
Free Web proxy security tools software testers should get to know
How to get management on board with Web 2.0 security issues
Web application security best practices: Tips on implementation
Testing strategies for complex environments
How to make your software tamperproof
Ways to approach application performance testing on a tight budget
How can I tell if my software security has been breached?

Building security into the SDLC (Software development life cycle)
Problems caused by skipping analysis stage of SDLC
Inexpensive phase of SDLC to catch and fix bugs
GatherSpace beefs up cloud-based requirements management
ALM: Best of breed vs. complete systems
Software development life cycle phases, iterations, explained step by step
The role of quality assurance (QA) pros in software security
Common software security risks and oversights
Why the quality assurance department should be involved in testing
How to develop secure applications
Secure software development practices 'not rocket science'

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Software Development Methods - Extreme Programming, Agile Programming, Scrum
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2006 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts