Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN 04.09.xx VS Fortify Source Code Analysis ToolDNN 04.09.xx VS Fortify Source Code Analysis Tool
Previous
 
Next
New Post
7/10/2009 1:37 PM
 

Greetings...

I'm starting this forum in order to learn whether other developers have any experience with FortifySCA analysis of DNN.

We have the FortifySCA (Source Code Analysis) tool and I have run an analysis of the source code for version 04.09.xx.   The results were impressive, however, there are still 247 "Hot" hits in the analysis results.  A "hot" issue is one which should be fixed ASAP because it has located a vulnerability in the code. 

A further breakdown of the 247 "hot" issues are:

Cross-site scripting (221)

Header Manipulation (22)

Header Manipulation - Cookies (4)

I guess my questions are:

    1)  Have any of you had to mitigate these types of issues?  If so, how did you do that without changing DNN source code so that you can benefit from future upgrades?

    2)  How would I go about reporting the issues (so that they can be fixed)?  If the general concensus is that they do not need to be corrected, then I would ask why not?

 

SAMPLE BEGINS HERE:

Abstract:
The method __DataBinding__control5() in AddToEvent.ascx sends unvalidated data to a web browser on line 18, which can result in the browser executing malicious code.

Explanation:
Cross-site scripting (XSS) vulnerabilities occur when:

1. Data enters a web application through an untrusted source, most frequently a web request or database.

In this case the data enters at Eval() in AddToEvent.ascx at line 18.

2. The data is included in dynamic content that is sent to a web user without being validated for malicious code.

In this case the data is sent at set_NavigateUrl()  in AddToEvent.ascx at line 18.

The malicious content sent to the web browser often takes the form of a segment of JavaScript, but may also include HTML, Flash or any other type of code that the browser may execute. The variety of attacks based on XSS is almost limitless, but they commonly include transmitting private data like cookies or other session information to the attacker, redirecting the victim to web content controlled by the attacker, or performing other malicious operations on the user's machine under the guise of the vulnerable site.

Example 1: The following ASP.NET code segment reads an employee ID number from an HTTP request and displays it to the user.


protected System.Web.UI.WebControls.TextBox Login;
protected System.Web.UI.WebControls.Label EmployeeID;
...
EmployeeID.Text = Login.Text;



The code in this example operates correctly if Login contains only standard alphanumeric text. If Login has a value that includes meta-characters or source code, then the code will be executed by the web browser as it displays the HTTP response.

Initially this might not appear to be much of a vulnerability. After all, why would someone enter a URL that causes malicious code to run on their own computer?  The real danger is that an attacker will create the malicious URL, then use e-mail or social engineering tricks in order to lure victims into clicking a link. When the victims click the link, they unwittingly reflect the malicious content through the vulnerable web application and back to their own computers. This mechanism of exploiting vulnerable web applications is known as Reflected XSS.

Example 2: The following ASP.NET code segment queries a database for an employee with a given employee ID and prints the name corresponding with the ID.


protected System.Web.UI.WebControls.Label EmployeeName;
...
    string query = "select * from emp where id=" + eid;
    sda = new SqlDataAdapter(query, conn);
    sda.Fill(dt);
    string name = dt.Rows[0]["Name"];
    ...
    EmployeeName.Text = name;



As in Example 1, this code functions correctly when the values of name are well-behaved, but it does nothing to prevent exploits if they are not. Again, this code can appear less dangerous because the value of name is read from a database, whose contents are apparently managed by the application. However, if the value of name originates from user-supplied data, then the database can be a conduit for malicious content. Without proper input validation on all data stored in the database, an attacker can execute malicious commands in the user's web browser. This type of exploit, known as Stored XSS, is particularly insidious because the indirection caused by the data store makes it more difficult to identify the threat and increases the possibility that the attack will affect multiple users. XSS got its start in this form with web sites that offered a "guestbook" to visitors. Attackers would include JavaScript in their guestbook entries, and all subsequent visitors to the guestbook page would execute the malicious code.

As the examples demonstrate, XSS vulnerabilities are caused by code that includes unvalidated data in an HTTP response. There are three vectors by which an XSS attack can reach a victim:

- As in Example 1, data is read directly from the HTTP request and reflected back in the HTTP response. Reflected XSS exploits occur when an attacker causes a user to supply dangerous content to a vulnerable web application, which is then reflected back to the user and executed by the web browser. The most common mechanism for delivering malicious content is to include it as a parameter in a URL that is posted publicly or e-mailed directly to victims. URLs constructed in this manner constitute the core of many phishing schemes, whereby an attacker convinces victims to visit a URL that refers to a vulnerable site. After the site reflects the attacker's content back to the user, the content is executed and proceeds to transfer private information, such as cookies that may include session information, from the user's machine to the attacker or perform other nefarious activities.

- As in Example 2, the application stores dangerous data in a database or other trusted data store. The dangerous data is subsequently read back into the application and included in dynamic content. Stored XSS exploits occur when an attacker injects dangerous content into a data store that is later read and included in dynamic content. From an attacker's perspective, the optimal place to inject malicious content is in an area that is displayed to either many users or particularly interesting users. Interesting users typically have elevated privileges in the application or interact with sensitive data that is valuable to the attacker. If one of these users executes malicious content, the attacker may be able to perform privileged operations on behalf of the user or gain access to sensitive data belonging to the user.

- A source outside the application stores dangerous data in a database or other data store, and the dangerous data is subsequently read back into the application as trusted data and included in dynamic content.
 

END OF SAMPLE

Thank you in advance for participating,

Tim

 
New Post
7/10/2009 7:47 PM
 

please email a copy of your report to security@dotnetnuke.com so we can analyze the results. We've had a copy of a fortify report before and it contained lots of false positives (e.g. Microosft added code to asp.net 2.0 to stop header manipulation and it misses some of our core input filtering)

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/10/2009 8:02 PM
 

please note, I took a check for the indicated file (AddToEvent.ascx) and it's not a file in dotnetnuke or any of the associated core projects. I did a quick check and it's from a 3rd party module, so you may wish to let that module developer know about the problem. Also, if you could re-run your analysis on a version that does not contain 3rd party modules, it will reduce the effort required to triage the report.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
New Post
7/13/2009 10:23 AM
 

Cathal,

"AddToEvent.ascx" was just one example.  There are plenty of DNN core files that have been cited as well.

How shall I provide the report to the group?  What would be acceptable output?  Are you able to read .fpr files?

Thank you for taking this seriously.  I work for the Air Force and I would really like to be able to use this product but I need to be able to mitigate these issues while not affecting the ability to upgrade later.

Tim

 
New Post
7/13/2009 11:02 AM
 

Tim,

i appreciate that "addtoevent.asxcx" is just one example, but I've done analysis on fortify documents before and had to spend nearly 3 days going through 300+ pages of results, so I'd appreciate anything that reduces my workload - and realistically I don't have the time to analyse 3rd party modules.

If you could export the report to a format such as a word document (thats how we've received them before) that would be appreciated as I can't read .fpr files.

We take security very seriously, and all always very happy to receive audits/reports from community members, as any resultant updates benefit everyone.

Cathal


Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...DNN 04.09.xx VS Fortify Source Code Analysis ToolDNN 04.09.xx VS Fortify Source Code Analysis Tool


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out