Checkmarx Connection String Injection Issue on Excel File Uplaod
MUHAMMAD AZEEM AZAM
1
Reputation point
I'm using Checkmarx that scans source code and identifies security vulnerabilities within the code
<asp:FileUpload ID="fuXlsWorkflow" runat="server" EnableViewState="true" />
<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="<%$ Resources:Message,ERR_FORMAT%>" ValidationExpression="^([a-zA-Z]|\x20|\x2E|:|\|[0-9])*.(xls|xlsx)$" ControlToValidate="fuXlsWorkflow" />
checkmarx detects a vulnerability on fuXlsWorkflow.FileName
file name is also passed to OLEDB Connection string.
i did tried HtmlEncode, but it didn't worked out.
Developer technologies | ASP.NET | ASP.NET API
Developer technologies | ASP.NET | ASP.NET API
A component of ASP.NET for creating RESTful web services that support HTTP-based communication between clients and servers.
Developer technologies | ASP.NET | Other
Developer technologies | ASP.NET | Other
A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
Sign in to answer