Posts

History of Nginx vulnerabilities until 2024

 CVE-2013-2028 - Buffer Overflow in Nginx This vulnerability is a buffer overflow caused by improper handling of certain chunked transfer encoding requests. It allows remote attackers to execute arbitrary code or crash the server. It was particularly dangerous as it could be exploited without authentication. CVE-2014-0133 - HTTP Header Injection in Nginx with PHP-CGI This issue allowed attackers to inject arbitrary HTTP headers by exploiting improper handling of certain HTTP request headers when Nginx is used with PHP-CGI. Attackers could manipulate headers to bypass security restrictions or conduct request-smuggling attacks. CVE-2014-3616 - SSL/TLS MITM Vulnerability (BEAST attack) This vulnerability affected configurations of Nginx with SSL/TLS. It allowed attackers to exploit weaknesses in SSL/TLS (especially SSLv3) and carry out man-in-the-middle (MITM) attacks. Although primarily an SSL issue, Nginx servers using old SSL versions were vulnerable. CVE-2015-5160 - Nginx Cache Po...

Path Traversal : Case-Sensitive Path Traversal

Summary A Case-Sensitive Path Traversal vulnerability is a security weakness where an attacker can exploit differences in case sensitivity when accessing files and directories. x Description Case-Sensitive Path Traversal Explanation On some systems (like Linux), file paths are  case-sensitive  (e.g.,  config.txt  is different from  Config.txt ). On others (like Windows), they are  case-insensitive  (treating  config.txt  and  Config.txt  as the same file). When applications don’t properly handle this difference, attackers may exploit it to: Access Restricted Files : If a file is protected by access control, using a path with a different case could sometimes bypass these protections, allowing access to sensitive information. Circumvent Filters : Some applications try to block path traversal attacks by checking the path string for malicious characters (e.g.,  ../ ). But if they do so without considering case, attackers can manipu...

Insecure Direct Object Reference (IDOR)

 Sumary Insecure Direct Object Reference (IDOR) is a vulnerability that arises when attackers can access or modify objects by manipulating identifiers used in a web application's URLs or parameters. It occurs due to missing access control checks, which fail to verify whether a user should be allowed to access specific data. Examples For instance, when a user accesses their profile, the application might generate a URL like this: https://example.org/users/123 The 123 in the URL is a direct reference to the user's record in the database, often represented by the primary key. If an attacker changes this number to 124 and gains access to another user's information, the application is vulnerable to Insecure Direct Object Reference. This happens because the app didn't properly check if the user had permission to view data for user 124 before displaying it. In some cases, the identifier may not be in the URL, but rather in the POST body, as shown in the following example: <...

Cross Origin Resource Sharing (CORS) misconfiguration

  References: Cross Origin Resource Sharing (CORS) misconfiguration https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Security_Testing/11-Client-side_Testing/07-Testing_Cross_Origin_Resource_Sharing#:~:text=Access%2DControl%2DAllow%2DOrigin%20is%20a%20response%20header%20used,data%20based%20on%20this%20header.

COOKIE SECURITY : Cookie without SameSite Attribute

Summary SameSite prevents the browser from sending this cookie along with cross-site requests. The main goal is to mitigate the risk of cross-origin information leakage. It also provides some protection against cross-site request forgery attacks. Possible values for the flag are none, lax, or strict. The strict value will prevent the cookie from being sent by the browser to the target site in all cross-site browsing contexts, even when following a regular link. For example, for a GitHub-like website this would mean that if a logged-in user follows a link to a private GitHub project posted on a corporate discussion forum or email, GitHub will not receive the session cookie and the user will not be able to access the project. A bank website however most likely doesn’t want to allow any transactional pages to be linked from external sites so the strict flag would be most appropriate here. The lax value provides a reasonable balance between security and usability for websites that want to ...

System Information Leak : External

 System Information Leak : External CWE-497, CWE-489, CWE-215, CWE-11, CWE-200 OWASP Top 10: PCI 3.2: 6.5.5 Improper Error Handling Summary This means that a possible debug application was found. Debug applications are tools used by developers when building web applications. They are used to test and modify web application properties, configuration information, and functions. If a debug application is left on a production server, an attacker may be able to use it to perform these tasks. Recommendations include removing the debugging interface. Explanation The severity of the exposed debug application will depend on the particular instance. At the least, it will give an attacker sensitive information about the settings and mechanics of web applications on the server. At worst, as is often the case, the debug application will allow an attacker complete control over the web application and server, as well as confidential information that either of these access. Recomendation Remove th...

Cookie Security : Cookie not Sent Over SSL

 Cookie Security : Cookie not Sent Over SSL CWE-614 OWASP Top 10: A3 PCI 3.2: 4.1 Use strong cryptography and security protocols, 6.5.4 Insecure Communications Summary This policy states that any area of the website or web application that contains sensitive information or access to privileged functionality such as remote site administration requires that all cookies are sent via SSL during an SSL session.  If a cookie is marked with the "secure" attribute, it will only be transmitted if the communications channel with the host is a secure one. Currently this means that secure cookies will only be sent to HTTPS (HTTP over SSL) servers. If secure is not specified, a cookie is considered safe to be sent in the clear over unsecured channels. Recommendation For Development: This issue will ultimately need to be rectified by your Network or Security Operations team. If necessary, implement the change in your development environment. 

COOKIE SECURITY : Persistent Cookie

  COOKIE SECURITY : Persistent Cookie CWE-613, CWE-539 OWASP Top 10: A3 PCI 3.2: 6.5.1 Injection Flaws, 6.5.3 Insecure Cryptographic Storage Summary Cookies are small bits of data that are sent by the web application but stored locally in the browser. This lets the application use the cookie to pass information between pages and store variable information. The web application controls what information is stored in a cookie and how it is used. Typical types of information stored in cookies are session Identifiers, personalization and customization information, and in rare cases even usernames to enable automated logins. There are two different types of cookies: session cookies and persistent cookies. Session cookies only live in the browser's memory, and are not stored anywhere. Persistent cookies, however, are stored on the browser's hard drive. This can cause security and privacy issues depending on the information stored in the cookie and how it is accessed. Explanation Persi...

Insecure Transport - Weak SSL Cipher

Weak SSL Cipher It primarily focuses on how to use TLS to protect clients connecting to a web application over HTTPS, though much of this guidance is also applicable to other uses of TLS. When correctly implemented, TLS can provide several security benefits: Confidentiality: Provides protection against attackers reading the contents of the traffic. Integrity: Provides protection against traffic modification, such as an attacker replaying requests against the server. Authentication: Enables the client to confirm they are connected to the legitimate server. Note that the identity of the client is not verified unless client certificates are employed. SSL vs TLS Secure Socket Layer (SSL) was the original protocol that was used to provide encryption for HTTP traffic, in the form of HTTPS. There were two publicly released versions of SSL - versions 2 and 3. Both of these have serious cryptographic weaknesses and should no longer be used. For various reasons the next version of the protocol (...

INSECURE DEPLOYMENT : Unpatched Application

Summary   Failure to install up-to-date patches could lead to severe system compromise Explanation Third party applications, application servers, or web frameworks with known vulnerabilities expands the attack surface available to the attacker. Remedation Update the components that were identified by the pentester as potentially vulnerable. References:  https://owasp.org/Top10/A06_2021-Vulnerable_and_Outdated_Components/

Apache header directives for security

This is a list of header directives for to increment security site. You have two ways for set this security header, from .htacess or from your web server. Example using ".htaccess"  <IfModule mod_headers.c>      Header set X-Frame-Options "DENY"  </IfModule>   You can set using "Header set" followed by header policy.  This is a list from more commons.   Content-Security-Policy Examples 1  <IfModule mod_headers.c>     Header set Content-Security-Policy "default-src 'self' style-src 'self' 'unsafe-inline' fonts.googleapis.com script-src 'self' font-src 'self' fonts.gstatic.com "  </IfModule>   You can find a complete documentation on this link:  Directives for bootstrap  https://content-security-policy.com/examples/google-fonts/ https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy  Strict Transp...

Code Correctness: Untested Functionality

Summary During security testing of the target application, some of the functionality was found to be inoperable. As such, any potential security vulnerabilities associated with this functionality could not be evaluated and its controls could not be verified. Explanation Gaps in testing coverage could leave significant vulnerabilities unreported, leading to a false sense of security while leaving the application open to attack and/or compromise. Recommendation Ensure that all key application functionality is operational and ready for security testing to ensure completeness of coverage.

Poor Error Handling: Unhandled Exception

Summary Unhandled exceptions are circumstances in which the application has received user input that it did not expect and does not know how to handle. When successfully exploited, an attacker can gain unauthorized access to the database by using the information recovered from seemingly innocuous error messages to pinpoint flaws in the web application and to discover additional  venues of attack. Recommendations include designing and adding consistent error-handling mechanisms that are capable of handling any user input to your web application, providing meaningful detail to end-users, and preventing error messages that might provide information useful to an attacker from being displayed. Description The most common cause of an unhandled exception is a failure to properly sanitize client-supplied data that is used in SQL statements. They can also be caused by a bug in the web application's database communication code, a misconfiguration of database connection settings, an unavailab...

Cache Management: Insecure Policy

Image
Summary SSL contents on this site can be cached by browser or intermediate proxy server cache. Explanation SSL provides secure encrypted channel to transfer information from source to user. The information server over SSL is considered sensitive and trusted to be only available to requestor. However, caching these content on disk in temporary internet files or in intermediate proxy server can compromise that trust by exposing it to everyone who has access to these temporary storage or proxy cache. Hence these content served over SSL should have cache disabled. Execution Send a request to https://yourdomain.com:443/site/login and inspect the Cache-Control header value. Recommendation Set Cache-Control directive to private, no-cache and/or no-store. private This directive allows the server to prevent a shared cache from caching responses that are intended for a single user. The mechanism can be used to ensure that privileged information is not accidentally leaked to unauthorized users. T...

HTML5 : Cross-Site Scripting Protection

Image
Summary X-XSS-Protection HTTP response header enables developers and security architects to manage browser protection against reflected cross-site scripting. The mechanism is also known as the XSS Auditor in Chrome and the XSS filter in Internet Explorer. In modern browsers, the Content-SecurityPolicy header can provide better protection against XSS and setting X-XSS-Protection might be redundant. However, this header can reduce the risk of reflected XSS attacks in earlier browsers that do not support CSP. This header can be set to one of three possible values: 0 , 1 , or 1 ; mode=block . A value of 0 disables the protection. A value of 1 is the default behaviour in modern browsers that enables the protection in filter or replacement mode. For example, IE replaces JavaScript keywords such as <script> with <scr#pt> to render injected string ineffective. The value of 1 ; mode=block instructs browsers to block the response from rendering in the browser. Reports of multiple exp...

Web Server Misconfiguration: Insecure Content-Type Setting

Image
Summary Almost all browsers are designed to use a mime sniffing technique to guess the content type of the HTTP response instead of adhering to the Content-Type specified by the application in specific cases or ignoring the content when no mime type is specified. Inconsistencies introduced by the mime sniffing techniques could allow attackers to conduct Cross-Site Scripting attacks or steal sensitive user data. WebInspect has determined that the application fails to instruct the browser to strictly enforce the Content-Type specification supplied in the response. Web server misconfiguration can cause an application to send HTTP responses with the missing Content-Type header or specify a mime type that does not match up accurately with the response content. When a browser receives such a response, it attempts to programmatically determine the mime type based on the content returned in the response. The mime type derived by the browser, however, might not accurately match the one intended...

Privacy Violation : Autocomplete

Summary Most recent browsers have features that will save password field content entered by users and then automatically complete password entry the next time the field are encountered. This feature is enabled by default and could leak password since it is stored on the hard drive of the user. The risk of this issue is greatly increased if users are accessing the application from a shared environment. Recommendations include setting autocomplete to "off" on all your password fields. Please Note: Recent versions of most browsers, as noted below, now ignore the autocomplete="off" attribute for password fields in html forms. Users are allowed to decide the password policy at their own discretion using the password manager. Although setting is ineffective on these versions of browsers, it would continue to protect website users of earlier versions of these and other browsers that support this attribute. Browsers NOT Supporting autocomplete="off": 1. Internet E...

Inadequate Firewall Policy

Summary The web server has a number of system hardening issues related to listening services and open ports. Explanation Any number of open services may have vulnerabilities which could result in remote code execution or denial of service attacks. Execution A port scanning tool will return the open/listening ports. Recommendation Determine the need for listening services and open ports and adjust the system configuration accordingly. Make sure all listening services are fully patched and maintained as part of a comprehensive patch management program. Examples:  This command show public openeds ports.   nmap -v -p yourdomain.com

Insecure Transport: Channel Mixing

Summary If a server has sensitive information on it that  hould only be exchanged via SSL, it should not be possible to access this information using a non-SSL connection. Explanation An attacker could potentially intercept sensitive data including usernames and passwords, customer account information, or similar information. Recommendation Disable the unencrypted web service. Examples: If you type a command:    curl -i yourdomain.com If it response "301 Moved Permanently" its means your server have channel Mixing. If your server reponse "Failed connect to <yourdomain.com> port 80: Connection timed out" its means your server is protected because your server don't permit connecions by port 80 (Not secure).

Insecure Transport: Weak SSL Protocol

Summary The Transport Layer Security (TLS) protocol provides a protection mechanism to better protect authenticity, confidentiality and integrity of the data transmitted between a client and a web server. The TLS protocol has undergone various revisions resulting in periodic version updates. Each revision tries to address security weakness in prior versions and incorporate support for the latest in security measures. It is strongly recommended to use the latest version of the available protocol, whenever possible. TLS 1.0 is considered insecure as it lacks support for strong ciphersuites and is known to be plagued by several known vulnerabilities. It either uses RC4 cipher, which is prone to bias attacks or uses Cipher Block Chaining (CBC) mode cipher, which enables condition for POODLE (Padding Oracle OnDowngraded Legacy Encryption) attacks. NIST Special Publication 800-52 Revision 1 no longer considers TLS 1.0 as strong cryptography. TLS 1.0 is also no longer in compliance with PCI D...