Sample Report, Client Anonymized

Premium OWASP Penetration Testing Report

Full black-box penetration test of a production web platform. Client name, URLs and infrastructure details are redacted.

Black-box penetration testOWASP WSTG v4.28 findings3 High2 Medium2 Low1 InformationalUnlimited retests

Management Summary

contacted Sayfer Security in order to perform full black-box penetration testing on the web platform.

Before assessing these services we held a kickoff meeting with the technical team and received an overview of the system and the goals for this assessment.

Over the assessment, we discovered 8 vulnerabilities in the system, 3 of which are at high risk. The first vulnerability lets an anonymous attacker enumerate archive file names and get access to these files. The second vulnerability lets an anonymous attacker to DoS the API by abusing the rate limit mechanism. Other vulnerabilities do not have a high impact on the system but should be fixed and these are described in this report in more technical details.

Vulnerabilities by Severity

3 High2 Medium2 Low1 Informational
  • High – Direct threat to key business processes.
  • Medium – Indirect threat to key business processes or partial threat to business processes.
  • Low – No direct threat exists. The vulnerability may be exploited using other vulnerabilities.
  • Informational – This finding does not indicate vulnerability, but states a comment that notifies about design flaws and improper implementation that might cause a problem in the long run.

Approach

Introduction

contacted Sayfer Security in order to perform full black-box penetration testing for .

This report documents a security assessment carried out by Sayfer targeting both applications. Particularly, this report displays the security posture review for both applications and their surrounding infrastructure and process implementations.

Scope Overview

During our first meeting with , after understanding the company's needs, we defined the application's scope that resides at the following URLs as the scope of the project:

Our tests were performed between .

Technical Overview

Scope Validation

Before starting looking for security vulnerabilities we made sure the scope defined to us by the client was technically logical.

It is a very common mistake to forget an old server or account connected to the internet with permissions to access or control the system that is being audited under the defined scope.

By performing the scope validation we made sure that there are no unknown risks to the tested system.

Threat Model

During our kickoff meetings with the client, we defined the most important assets the application possesses.

Security Evaluation Methodology

Sayfer uses OWASP WSTG as our technical standard when reviewing web applications.

After gaining a thorough understanding of the system we decided which OWASP tests are required to evaluate the system.

Security Assessment

After understanding and defining the scope, performing threat modeling, and evaluating the correct tests required in order to fully check the application for security flaws, we performed our security assessment.

Issue Table Description

IDThe OWASP ID of the issue. Additional tests that we conduct and are not included in the OWASP table will have Sayfer ID. Example ID: WSTG-INFO-002 (WSTG = Web Security Test Guide, INFO = topic shorthand, 002 = issue number).
RiskRepresents the risk factor of the issue. For further description refer to the Vulnerabilities by Severity section.
Required SkillDescribes the skill level required to conduct successful exploitation. The lower the skill level the easier the exploitation process.
OWASP ReferenceA link to the relevant OWASP page for further knowledge.
LocationThe URL in which this issue was detected. Issues with no location have no particular location and refer to the product as a whole.
ToolsThe tools used to detect the issue.
DescriptionA brief description of the issue and how it formed, the steps we made to find or exploit it, along with proof of concept (if present), and how this issue can affect the product or its users.
MitigationSuggested resolving options for this issue and links to advised sites for further remediation.

Security Evaluation

The following tests were conducted while auditing the system. All 97 OWASP WSTG tests passed except where noted in the findings below.

Information Gathering10 tests, all passed
WSTG-INFO-01Conduct Search Engine Discovery Reconnaissance for Information LeakagePass
WSTG-INFO-02Fingerprint Web ServerPass
WSTG-INFO-03Review Webserver Metafiles for Information LeakagePass
WSTG-INFO-04Enumerate Applications on WebserverPass
WSTG-INFO-05Review Webpage Content for Information LeakagePass
WSTG-INFO-06Identify application entry pointsPass
WSTG-INFO-07Map execution paths through applicationPass
WSTG-INFO-08Fingerprint Web Application FrameworkPass
WSTG-INFO-09Fingerprint Web ApplicationPass
WSTG-INFO-10Map Application ArchitecturePass
Configuration and Deploy Management Testing11 tests, all passed
WSTG-CONF-01Test Network Infrastructure ConfigurationPass
WSTG-CONF-02Test Application Platform ConfigurationPass
WSTG-CONF-03Test File Extensions Handling for Sensitive InformationPass
WSTG-CONF-04Review Old Backup and Unreferenced Files for Sensitive InformationPass
WSTG-CONF-05Enumerate Infrastructure and Application Admin InterfacesPass
WSTG-CONF-06Test HTTP MethodsPass
WSTG-CONF-07Test HTTP Strict Transport SecurityPass
WSTG-CONF-08Test RIA cross domain policyPass
WSTG-CONF-09Test File PermissionPass
WSTG-CONF-10Test for Subdomain TakeoverPass
WSTG-CONF-11Test Cloud StoragePass
Identity Management Testing5 tests, all passed
WSTG-IDNT-01Test Role DefinitionsPass
WSTG-IDNT-02Test User Registration ProcessPass
WSTG-IDNT-03Test Account Provisioning ProcessPass
WSTG-IDNT-04Testing for Account Enumeration and Guessable User AccountPass
WSTG-IDNT-05Testing for Weak or Unenforced Username PolicyPass
Authentication Testing10 tests, all passed
WSTG-ATHN-01Testing for Credentials Transported over an Encrypted ChannelPass
WSTG-ATHN-02Testing for Default CredentialsPass
WSTG-ATHN-03Testing for Weak Lock Out MechanismPass
WSTG-ATHN-04Testing for Bypassing Authentication SchemaPass
WSTG-ATHN-05Testing for Vulnerable Remember PasswordPass
WSTG-ATHN-06Testing for Browser Cache WeaknessesPass
WSTG-ATHN-07Testing for Weak Password PolicyPass
WSTG-ATHN-08Testing for Weak Security Question AnswerPass
WSTG-ATHN-09Testing for Weak Password Change or Reset FunctionalitiesPass
WSTG-ATHN-10Testing for Weaker Authentication in Alternative ChannelPass
Authorization Testing4 tests, all passed
WSTG-ATHZ-01Testing Directory Traversal File IncludePass
WSTG-ATHZ-02Testing for Bypassing Authorization SchemaPass
WSTG-ATHZ-03Testing for Privilege EscalationPass
WSTG-ATHZ-04Testing for Insecure Direct Object ReferencesPass
Session Management Testing9 tests, all passed
WSTG-SESS-01Testing for Session Management SchemaPass
WSTG-SESS-02Testing for Cookies AttributesPass
WSTG-SESS-03Testing for Session FixationPass
WSTG-SESS-04Testing for Exposed Session VariablesPass
WSTG-SESS-05Testing for Cross Site Request ForgeryPass
WSTG-SESS-06Testing for Logout FunctionalityPass
WSTG-SESS-07Testing Session TimeoutPass
WSTG-SESS-08Testing for Session PuzzlingPass
WSTG-SESS-09Testing for Session HijackingPass
Data Validation Testing19 tests, all passed
WSTG-INPV-01Testing for Reflected Cross Site ScriptingPass
WSTG-INPV-02Testing for Stored Cross Site ScriptingPass
WSTG-INPV-03Testing for HTTP Verb TamperingPass
WSTG-INPV-04Testing for HTTP Parameter PollutionPass
WSTG-INPV-05Testing for SQL InjectionPass
WSTG-INPV-06Testing for LDAP InjectionPass
WSTG-INPV-07Testing for XML InjectionPass
WSTG-INPV-08Testing for SSI InjectionPass
WSTG-INPV-09Testing for XPath InjectionPass
WSTG-INPV-10Testing for IMAP SMTP InjectionPass
WSTG-INPV-11Testing for Code InjectionPass
WSTG-INPV-12Testing for Command InjectionPass
WSTG-INPV-13Testing for Format String InjectionPass
WSTG-INPV-14Testing for Incubated VulnerabilityPass
WSTG-INPV-15Testing for HTTP Splitting SmugglingPass
WSTG-INPV-16Testing for HTTP Incoming RequestsPass
WSTG-INPV-17Testing for Host Header InjectionPass
WSTG-INPV-18Testing for Server-side Template InjectionPass
WSTG-INPV-19Testing for Server-Side Request ForgeryPass
Error Handling2 tests, all passed
WSTG-ERRH-01Testing for Improper Error HandlingPass
WSTG-ERRH-02Testing for Stack TracesPass
Cryptography4 tests, all passed
WSTG-CRYP-01Testing for Weak Transport Layer SecurityPass
WSTG-CRYP-02Testing for Padding OraclePass
WSTG-CRYP-03Testing for Sensitive Information Sent via Unencrypted ChannelsPass
WSTG-CRYP-04Testing for Weak EncryptionPass
Business Logic Testing9 tests, all passed
WSTG-BUSL-01Test Business Logic Data ValidationPass
WSTG-BUSL-02Test Ability to Forge RequestsPass
WSTG-BUSL-03Test Integrity ChecksPass
WSTG-BUSL-04Test for Process TimingPass
WSTG-BUSL-05Test Number of Times a Function Can be Used LimitsPass
WSTG-BUSL-06Testing for the Circumvention of Work FlowsPass
WSTG-BUSL-07Test Defenses Against Application Mis-usePass
WSTG-BUSL-08Test Upload of Unexpected File TypesPass
WSTG-BUSL-09Test Upload of Malicious FilesPass
Client Side Testing13 tests, all passed
WSTG-CLNT-01Testing for DOM-Based Cross Site ScriptingPass
WSTG-CLNT-02Testing for JavaScript ExecutionPass
WSTG-CLNT-03Testing for HTML InjectionPass
WSTG-CLNT-04Testing for Client Side URL RedirectPass
WSTG-CLNT-05Testing for CSS InjectionPass
WSTG-CLNT-06Testing for Client Side Resource ManipulationPass
WSTG-CLNT-07Test Cross Origin Resource SharingPass
WSTG-CLNT-08Testing for Cross Site FlashingPass
WSTG-CLNT-09Testing for ClickjackingPass
WSTG-CLNT-10Testing WebSocketsPass
WSTG-CLNT-11Test Web MessagingPass
WSTG-CLNT-12Testing Browser StoragePass
WSTG-CLNT-13Testing for Cross Site Script InclusionPass
API Testing1 tests, all passed
WSTG-APIT-01Testing GraphQLPass

Security Assessment Findings

1. Stored (Dom-based) Cross-Site Scripting

High risk
IDWSTG-INPV-02
RiskHigh
Required SkillLow
Location
ToolsBurp repeater, Web browser

Description

It is possible to modify the HTML content of the templates and include an XSS payload within it, which is stored on the server and accessed when users view the page.

Stored XSS occurs when a web application gathers input from a user which might be malicious, and then stores that input in a data store for later use. The input that is stored is not correctly filtered. As a consequence, the malicious data will appear to be part of the website and run within the user’s browser under the privileges of the web application.

Assuming the payload successfully bypasses Cloudflare / WAF (which we were able to do) it is possible to save it. From that point, anyone “previewing” the email would instantly trigger the XSS, in addition to any users using an insecure mail client who received this email.

An attacker with access to the portal can target other users in the same tenant account, running malicious javascript code on their browser targeting to steal cookies, keylogging, etc.

Mitigation

Preventing cross-site scripting is trivial in some cases but can be much harder depending on the complexity of the application and the ways it handles user-controllable data.

In general, effectively preventing XSS vulnerabilities is likely to involve a combination of the following measures:

  • Filter input. At the point where user input is received, filter as strictly as

possible based on what is expected or valid input.

  • Encode output. At the point where user-controllable data is output in HTTP

responses, encode the output to prevent it from being interpreted as active content. Depending on the output context, this might require applying combinations of HTML, URL, JavaScript, and CSS encoding.

  • Content Security Policy. As a last line of defense, you can use Content

Security Policy (CSP) to reduce the severity of any XSS vulnerabilities that still occur.

2. Credentials Spraying Attack

High risk
IDWSTG-BUSL-05
RiskHigh
Required SkillLow
Location
ToolsBurp Repeater, Burp Intruder, Web browser

Description

Brute force prevention mechanisms are not effective against credential spraying attacks. This vulnerability mostly affects the fields that are accessible by unauthenticated users as it allows brute-forcing user names or spamming and possibly performing DOS (Denial of Service) attacks.

Many of the problems that applications solve require limits to the number of times a function can be used or action can be executed. Applications must be “smart enough” to not allow the user to exceed their limit on the use of these functions, since in many cases each time the function is used the user may gain some type of benefit that must be accounted for to properly compensate the owner.

It was noticed that on any input fields designed to be used by unauthenticated users (login, registration, and forgotten password) the application tends to prevent brute force attacks after 20 sequent requests. However, if the requests are made each containing different credentials the control does not stop the attacker and permits sending the request an unlimited amount of times.

  • We successfully made 1000 requests to with a Password

Spraying attack, using different usernames for each request.

For example, it is possible to abuse the send SMS functionality to send numerous/continuous SMS messages to clients and random people by making thousands of requests for either “new registration” or “forgotten password”, using different phone numbers for each request.

The anti-automation control is ineffective against credential spraying attacks like the one described above. In addition, this could be an inconvenience for both the users/clients (i.e. reputation damage) as well as it will most likely enquire cost to for all the SMS being sent out.

Mitigation

The application should set hard controls to prevent limit abuse. This can be achieved by setting a rate limit for the requests each IP can make per minute, a CAPTCHA on multiple requests in a short amount of time, set a counter limit per user on the back end or database level, as all users should be identified through a session, whichever is better for the business requirement.

3. CloudFront Bypass

Medium risk
RiskMedium
Required SkillLow
Location
ToolsDnsSpy

Description

We successfully bypassed CloudFront by finding the IP of the server and requesting it directly.

During the assessment we looked for bypassing Cloudflare and Cloudfront and obtaining the real IP of the web application. We used different online tools for searching the DNS history of the domain. The generated DNS report from DnsSpy leaked important IP addresses and could be seen here .

The results showed the IP address of & . We used this information to bypass the Cloudfront protection, by redirecting all requests to to this IP.

We confirmed the bypass by comparing two responses, one from the IP and another from the actual URL

  • Response to IP request

  • Response to URL request contains the following

In addition the scan provided one more IP address that looks like an deprecated web site This application was not behind any WAF and it had references to 2021 in the footer (indicating that it hasn’t been updated recently). This could either be the previous version of the www website, or the new one under development.

With this an attacker can 1. Bypass logging which cloudfront offers 2. Bypass potential WAF rules that cloudfront could be enforcing 3. Potentially bypass any access controls which are placed on traffic coming from cloudfront (and not from anywhere else).

Mitigation

Encapsulate all subdomains to one alias that is behind CloudFront to mitigate this issue.

4. Absence of Rate Limit - Brute Forcing Verification Code

Medium risk
IDWSTG-BUSL-05
RiskMedium
Required SkillLow
Location
ToolsBurp intruder

Description

The 6-digit code used in the reset password functionality is vulnerable to brute-force attacks as it is not invalidated after an unsuccessful attempt.

As part of the email change functionality within the user profile settings, a user can update their email by first making a request to get a code via , and then verifying the ownership of the email by providing a 6-digit verification code which is sent over the email. It was found that this code does not get invalidated after a series of unsuccessful attempts. We were able to brute force the code with over 2,000 requests and reset users password using this code.

Considering the token is valid for 10 minutes (before you can request a new code and try again) it is very likely that an attacker can easily brute-force the code and verify an email address they don’t own or control. This could be used as part of a phishing attack where the user can then attempt to represent an organization that they are actually not a part of (for example having @apple.com email address saying they represent Apple).

Mitigation

It is important to set limits on the usage of functionalities as part of brute force prevention, denial of service protection, enumeration etc.

5. Blocking New Users Registration

High risk
IDWSTG-BUSL-07
RiskHigh
Required SkillLow
Location
ToolsBrowser

Description

Using the registration page logic flaw, any user can potentially block other new users from registering to the site.

The misuse and invalid use of valid functionality can identify attacks attempting to enumerate the web application, identify weaknesses, and exploit vulnerabilities. Validation mechanisms should be implemented in such cases to prevent misuse and restrict unwanted behavior.

There is a logical bug in the registration process of the application. Whenever a user attempts to register, they provide a phone number to which they should receive a code to activate the account. However, it was found that if a phone number is “registered” but never activated, this number can no longer be used to register a new user.

  • Attacker registers with random mobile number:

  • Server response:

A new user with the same phone number tries to register, but the phone number is blocked by the attacker.

  • Server response to user registration request:

This vulnerability can be exploited by innocent users who mistyped their phone numbers potentially blocking the registration of another future user.

The lack of active defenses allows an attacker to perform a Denial of Service attack without any recourse. The application’s owner will thus not know their application is under attack.

Mitigation

The solution is to block the phone number after the activation after the registration process finishes.

6. Access Control - Private Information Leakage

Medium risk
IDWSTG-ATHZ-02
RiskMedium
Required SkillLow
Location
ToolsBurp repeater

Description

Accounts can view private information of others by cycling the numbers of the parameter.

We confirmed that the merchant account we were given can view the information of other accounts. parameter represents the merchants accounts registred in the application. Its value is numeric and the ids are ordered sequentially. By passing any numeric value to this parameter, the user can view the account profile of another merchant thus gaining access to their personal information, resulting an IDOR vulnerability.

This was confirmed to be a vulnerability as the accounts that should be available to our user were given by making a different request.

  • A request to an endpoint returning a list of available accounts
Mitigation

Access control should be applied to the merchantid parameter as its available values should be different to each user.

7. Session Management - Session Hijacking

Medium risk
IDWSTG-SESS-07
RiskMedium
Required SkillMedium
ToolsBurp

Description

The session (i.e JWT) token is valid for 24 hours, which is problematic considering the inefficient logout mechanism and the fact it is possible to use the same token more than once resulting in concurrent sessions.

The JWT token is responsible to keep track of the user session and contains a timestamp to limit its validity. The application sets the timestamp of the JWT to 24 hours, making the token and thus the session valid even after the idle timeout is reached.

Another misconfiguration is the unrestricted amount of sessions that can run simultaneously. Although there is control over the maximum amount of concurrent sessions, it is still possible to establish more than one concurrent connection.

Hijacking the session can be done in numerous ways where in the end the attacker possesses the session token and uses it to impersonate a valid user. The timestamp and the concurrent logins limit should make it harder to use these tokens and create new sessions.

Mitigation

JWT timestamps can be updated by the server at any moment and should be as close to the session timeout as possible so no leakage of valid session tokens will accrue. In addition, if no more than one person should use an account, there is no need for multiple sessions running simultaneously. Otherwise, the restrictions should work as intended.

8. Improper Error Handling - Backend Communication Leakage

Informational risk
IDWSTG-ERRH-02
RiskInformational
Required SkillLow
Location
ToolsBrowser

Description

Error message with information about a failed request is being shown in the UI.

All types of applications (web apps, web servers, databases, etc.) will generate errors for various reasons. Developers often ignore handling these errors or push away the idea that a user will ever try to trigger an error purposefully (e.g. sending a string where an integer is expected).

During the assessment of the application, we used the XSS finding from the above section and made a further investigation of the “locations” GET parameter. The payload we used was as follows:

In response we got an error message appearing for a short time after clicking the refresh:

The message leak what kind of request is being made on the backend, and appears to have translated to the following GET request:

One of the conclusions of this leakage is that we can see that the connection is made through unsafe HTTP leading us to a new man in the middle attack vector.

Mitigation

Considering that this cluster doesn't appear to be on localhost, but rather a remote service, this cleartext traffic is not advised.

For remediation of the error handling, check out the Proactive Controls C10 and the Error Handling Cheat Sheet.

Appendix A: Security Evaluation Fixes

We found that all vulnerabilities found in our initial report were fixed during our second iteration.

systems that were evaluated in the scope of this penetration testing are certified by OWASP WSTG version 4.2 standard.