<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Bug: Restricted export format can be exported in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330611#M9052</link>
    <description>&lt;P&gt;Hi Vishal,&lt;/P&gt;&lt;P&gt;There is no security leak in the Viewer, all you need to do is select which Export Types you want your users to see as an option.&lt;/P&gt;&lt;P&gt;Add this to the Viewer code:&lt;/P&gt;&lt;P&gt;// set up the format export types:&lt;BR /&gt;int myFOpts = (int)(&lt;BR /&gt;  //CrystalDecisions.Shared.ViewerExportFormats.RptFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.PdfFormat |&lt;BR /&gt;  //CrystalDecisions.Shared.ViewerExportFormats.RptrFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.CsvFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.EditableRtfFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.RtfFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.WordFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.XmlFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat);&lt;BR /&gt;//CrystalDecisions.Shared.ViewerExportFormats.NoFormat); // no exports allowed&lt;BR /&gt;//int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);&lt;BR /&gt;&lt;BR /&gt;crystalReportViewer1.AllowedExportFormats = myFOpts;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2017 16:23:41 GMT</pubDate>
    <dc:creator>former_member11696</dc:creator>
    <dc:date>2017-02-22T16:23:41Z</dc:date>
    <item>
      <title>Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaq-p/330609</link>
      <description>&lt;P&gt;Hello Expert Team,&lt;/P&gt;&lt;P&gt;While decoding the crystal report's &lt;STRONG&gt;HTTP network request&lt;/STRONG&gt; for &lt;STRONG&gt;security audit&lt;/STRONG&gt;, we have come across a &lt;STRONG&gt;very serious threat and loopholes in crystal reports&lt;/STRONG&gt; which we see as &lt;STRONG&gt;very dangerous &lt;/STRONG&gt;if not addressed as early as possible. &lt;/P&gt;&lt;P&gt;This post is continuation to reproduce steps for the question: &lt;A target="_blank" href="https://answers.sap.com/questions/131436/bug-security-threat-breach-in-crystal-reports-need.html"&gt;Security Threat / Breach in Crystal Reports&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Development Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;&lt;A href="http://asp.net/"&gt;ASP.Net&lt;/A&gt; with Target Framework 4.6.1&lt;/LI&gt;&lt;LI&gt;Crystal Report 13.0.2000.0, Version: 13.0.19.2312&lt;/LI&gt;&lt;LI&gt;Oracle Database Server&lt;/LI&gt;&lt;LI&gt;IIS Server&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;STRONG&gt;Symptoms:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;It is required that if you are developing a sensitive data app, you may wants to keep your Database structure &amp;amp; Business Logic secured from end user.&lt;/P&gt;&lt;P&gt;Crystal Report gives option to specify allowed format to be exported, and hence many Application Developer will prefer to not to let export format like Crystal Reports &amp;amp; XML which contains the DB Structure &amp;amp; Business Logic. While there is other exploit available in Crystal Report allowing Crystal Report Formats to be download puts system at more risk.&lt;/P&gt;&lt;P&gt;Crystal Report should not allow to export format other than the one specified in Allowed Format.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps to reproduce:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Run the report in Mozilla Firefox&lt;/LI&gt;&lt;LI&gt;Enable Data Tamper Tool, and Click Start Record to Record request(If your browser don't have data tamper addon, then please get it added from Mozilla addons)&lt;/LI&gt;&lt;LI&gt;Click On Export Report Button&lt;/LI&gt;&lt;LI&gt;Now Select PDF format
and Click Export&lt;/LI&gt;&lt;LI&gt;Once Data Tamper request is visible, You will see that it has passed command as &lt;STRONG&gt;PDF&lt;/STRONG&gt; for download&lt;/LI&gt;&lt;LI&gt;Change this command to &lt;STRONG&gt;CrystalReports&lt;/STRONG&gt; and submit &lt;/LI&gt;&lt;LI&gt;This will download crystal report without checking what formats are allowed and what are restricted. &lt;/LI&gt;&lt;LI&gt;Please see the screenshot below &lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/21223-export-exploit-and-tampering.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Experts, Please at least put your comments if you able to reproduce and see this as a threat. &lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Temporary Solution: &lt;/STRONG&gt;While we wait for this bugs to be addressed by Crystal Report Experts team, you can restrict the export request base on Query String Parameters at server side manually.&lt;/P&gt;&lt;P&gt;For more threat and exploits in Crystal Report see the question here: &lt;A href="https://answers.sap.com/questions/131436/bug-security-threat-breach-in-crystal-reports-need.html"&gt;Security Threat / Breach in Crystal Reports&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Web.Config:
===========

&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;!--
  For more information on how to configure your ASP.NET application, please visit
  &lt;A href="http://go.microsoft.com/fwlink/?LinkId=169433" target="test_blank"&gt;http://go.microsoft.com/fwlink/?LinkId=169433&lt;/A&gt;
  --&amp;gt;
&amp;lt;configuration&amp;gt;
  &amp;lt;appSettings&amp;gt;
    &amp;lt;add key="CrystalImageCleaner-AutoStart" value="true"/&amp;gt;
    &amp;lt;add key="CrystalImageCleaner-Sleep" value="60000"/&amp;gt;
    &amp;lt;add key="CrystalImageCleaner-Age" value="120000"/&amp;gt;
  &amp;lt;/appSettings&amp;gt;
  &amp;lt;system.web&amp;gt;
    &amp;lt;compilation debug="true" targetFramework="4.6.1"&amp;gt;
      &amp;lt;assemblies&amp;gt;
        &amp;lt;add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&amp;gt;
        &amp;lt;add assembly="CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&amp;gt;
        &amp;lt;add assembly="CrystalDecisions.Web, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&amp;gt;
        &amp;lt;add assembly="CrystalDecisions.ReportSource, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/&amp;gt;
      &amp;lt;/assemblies&amp;gt;
    &amp;lt;/compilation&amp;gt;
    &amp;lt;sessionState mode="InProc" timeout="20"/&amp;gt;
  &amp;lt;/system.web&amp;gt;
&amp;lt;/configuration&amp;gt;

ReportViewer.aspx
===================
&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="ReportViewer.aspx.cs" Inherits="ReportViewer" %&amp;gt;
&amp;lt;%@ Register TagPrefix="CR" Namespace="CrystalDecisions.Web" Assembly="CrystalDecisions.Web" %&amp;gt;
&amp;lt;!DOCTYPE html&amp;gt;


&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head runat="server"&amp;gt;
    &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;form id="form1" runat="server"&amp;gt;
    &amp;lt;div&amp;gt;
&amp;lt;CR:CrystalReportViewer ID="ExternalCrystalReportViewer" runat="server"
            Height="1039px" 
            Width="901px" 
            ReuseParameterValuesOnRefresh="False" 
            HasRefreshButton="True" 
            HasCrystalLogo="False" 
            HasToggleParameterPanelButton="True" 
            ToolPanelView="ParameterPanel" 
            EnableDatabaseLogonPrompt="False"/&amp;gt;
    &amp;lt;/div&amp;gt;
    &amp;lt;/form&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;

ReportViewer.aspx.cs
====================
using System;
using CrystalDecisions.Shared;
using CrystalDecisions.CrystalReports.Engine;
using System.IO;


public partial class ReportViewer : System.Web.UI.Page
{
    private ConnectionInfo getconnetionInfo()
    {


        ConnectionInfo crConnectionInfo = new ConnectionInfo();
        crConnectionInfo.UserID = "user2";
        crConnectionInfo.Password = "user2";
        crConnectionInfo.ServerName = "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)(SERVICE_NAME = XE)))";


        return crConnectionInfo;
    }
    protected void Page_Init(object sender, EventArgs e)
    {
    }
    
    protected void Page_Load(object sender, EventArgs e)
    {        


        if (Session["rd"] == null)
        {
            try
            {
                ConnectionInfo crConnectionInfo = getconnetionInfo();


                
                string reportUrl = System.Web.HttpContext.Current.Server.MapPath("~/App_Data/" + "report-1.rpt");


                ReportDocument rd = new ReportDocument();
                rd.FileName = reportUrl;
                rd.Load(reportUrl, OpenReportMethod.OpenReportByTempCopy);

rd.SetDatabaseLogon(crConnectionInfo.UserID, crConnectionInfo.Password);


        ExternalCrystalReportViewer.AllowedExportFormats = (int)(ViewerExportFormats.ExcelRecordFormat |
                                                                ViewerExportFormats.XLSXFormat |
                                                                ViewerExportFormats.WordFormat |
                                                                ViewerExportFormats.PdfFormat);


                ExternalCrystalReportViewer.ReportSource = rd;
                Session["rd"] = rd;
            }
            catch (Exception ex)
            {
                //Manage Exceptions
            }
        }
        else
        {
            ExternalCrystalReportViewer.ReportSource = (ReportDocument)Session["rd"];
        }


    }
}&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Feb 2017 07:15:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaq-p/330609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-02-18T07:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330610#M9051</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Please readers and experts put your valuable comments &amp;amp; suggestion.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Feb 2017 07:31:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330610#M9051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-02-18T07:31:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330611#M9052</link>
      <description>&lt;P&gt;Hi Vishal,&lt;/P&gt;&lt;P&gt;There is no security leak in the Viewer, all you need to do is select which Export Types you want your users to see as an option.&lt;/P&gt;&lt;P&gt;Add this to the Viewer code:&lt;/P&gt;&lt;P&gt;// set up the format export types:&lt;BR /&gt;int myFOpts = (int)(&lt;BR /&gt;  //CrystalDecisions.Shared.ViewerExportFormats.RptFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.PdfFormat |&lt;BR /&gt;  //CrystalDecisions.Shared.ViewerExportFormats.RptrFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.XLSXFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.CsvFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.EditableRtfFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.RtfFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.WordFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.XmlFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelFormat |&lt;BR /&gt;  CrystalDecisions.Shared.ViewerExportFormats.ExcelRecordFormat);&lt;BR /&gt;//CrystalDecisions.Shared.ViewerExportFormats.NoFormat); // no exports allowed&lt;BR /&gt;//int myFOpts = (int)(CrystalDecisions.Shared.ViewerExportFormats.AllFormats);&lt;BR /&gt;&lt;BR /&gt;crystalReportViewer1.AllowedExportFormats = myFOpts;&lt;/P&gt;&lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2017 16:23:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330611#M9052</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2017-02-22T16:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330612#M9053</link>
      <description>&lt;P&gt;Thank you so much Mr.Don Williams for your valuable input, I was really waiting for your response.&lt;/P&gt;&lt;P&gt;As you suggested to set the format in Viewer, We have already set it as below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ExternalCrystalReportViewer.AllowedExportFormats = (int)(ViewerExportFormats.ExcelRecordFormat |
                                                                ViewerExportFormats.XLSXFormat |
                                                                ViewerExportFormats.WordFormat |
                                                                ViewerExportFormats.PdfFormat);
&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And as per the format set, Report will display only this four format for export, &lt;STRONG&gt;but hacker can manipulate this input at client side&lt;/STRONG&gt; and &lt;STRONG&gt;set any other format&lt;/STRONG&gt; they wants to download, and when it is requested &lt;STRONG&gt;&lt;EM&gt;at server side CR will not recheck before export that what formats were set to allowed.&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;As mentioned in my question, request you to please try this once in your Mozilla Browser with Data Tamper Tool:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Steps to reproduce:&lt;/STRONG&gt;&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;Run the report in Mozilla Firefox&lt;/LI&gt;&lt;LI&gt;Enable Data Tamper Tool, and Click Start Record to Record request(If your browser don't have data tamper addon, then please get it added from Mozilla addons)&lt;/LI&gt;&lt;LI&gt;Click On Export Report Button&lt;/LI&gt;&lt;LI&gt;Now Select PDF format and Click Export&lt;/LI&gt;&lt;LI&gt;Once Data Tamper request is visible, You will see that it has passed command as &lt;STRONG&gt;PDF&lt;/STRONG&gt; for download&lt;/LI&gt;&lt;LI&gt;Change this command to &lt;STRONG&gt;CrystalReports&lt;/STRONG&gt; and submit&lt;/LI&gt;&lt;LI&gt;This will download crystal report without checking what formats are allowed and what are restricted.&lt;/LI&gt;&lt;LI&gt;Please see the attached screenshot in the question.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Please let me know if you need any input to reproduce this incidence.&lt;/P&gt;&lt;P&gt;Once again thank you very much for your valuable input, and awaiting your comment.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2017 04:24:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330612#M9053</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-02-24T04:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330613#M9054</link>
      <description>&lt;P&gt;Please help handling this issue.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2017 15:56:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330613#M9054</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2017-03-02T15:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Bug: Restricted export format can be exported</title>
      <link>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330614#M9055</link>
      <description>&lt;P&gt;Hi Vishal,&lt;/P&gt;
  &lt;P&gt;I sent the link to DEV and they are going to look into this issue.&lt;/P&gt;
  &lt;P&gt;Incident 125375 / 2017 / Security Threat / Exploit in Crystal Reports, Restricted export format can be exported&lt;/P&gt;
  &lt;P&gt;This issue has been fixed and validated with some internal builds. The correction is currently planned to be available in the official version of:&lt;/P&gt;
  &lt;P&gt; - SAP BusinessObjects BI Platform .NET SDK Redistributable 4.1 SP11&lt;/P&gt;
  &lt;P&gt; - SAP BusinessObjects BI Platform .NET SDK Redistributable 4.2 SP5&lt;/P&gt;
  &lt;P&gt; - SAP Crystal Reports, version for Microsoft Visual Studio SP21&lt;/P&gt;
  &lt;P&gt;Thanks again&lt;/P&gt;
  &lt;P&gt;Don&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 13:35:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/bug-restricted-export-format-can-be-exported/qaa-p/330614#M9055</guid>
      <dc:creator>former_member11696</dc:creator>
      <dc:date>2017-03-16T13:35:56Z</dc:date>
    </item>
  </channel>
</rss>

