Blaze-Sample Web App Pentest Report
Blaze-Sample Web App Pentest Report
CLIENT DATE
ACME LTD. 21/11/2022
SUMMARY
1.3 Disclaimer
This document presents a detailed description of a web application security review on behalf of
ACME Ltd.
Blaze Information Security prioritized the identification of the largest possible number of
defective security controls an adversary would exploit to compromise the scope in question.
Blaze recommends conducting similar assessments on a regular basis to ensure the continued
security of the controls.
As a time-boxed and best-effort exercise, the nature of penetration testing does not guarantee
there are no other security issues in the scope under assessment, or that computer intrusion
will not happen in the future. The results of this document should not be read as investment
advice.
This document is the exclusive property of ACME Ltd. and Blaze Information Security. This
document contains proprietary and confidential information. Duplication, redistribution, or use,
in whole or in part, in any form, requires the express consent of both parties.
Blaze Information Security grants the customer permission to share this document with
business partners, auditors, and regulatory agencies that request proof of penetration testing
to satisfy compliance requirements, audits, onboarding, and other processes that may require
proof of pentest.
2.0 Introduction
This document presents the results of a Web Application Security Testing for ACME Ltd. This
engagement aimed to identify security vulnerabilities that could negatively affect the systems
under the scope, the data they handle, and consequently the business. Blaze Information
Security simulated in a systematic way, attacks that were specifically tailored for the
engagement’s scope to test the resilience against real-life attack scenarios.
For each vulnerability discovered during the assessment, Blaze Information Security attributed
a risk severity rating and, whenever possible, validated the existence of the vulnerability with
a working exploit code. The issues’ severity classification is based on the potential it presents
to provide means for fraud, data leakage, and other harmful events that may bring a direct
adverse impact to the business.
3.0 Scope
The applications ACME web platform, management backend, API, and their supporting
infrastructure were subjected to a security-focused test.
URL IP
https://web.acme.ltd 5.6.7.8
https://admin.acme.ltd 1.3.3.7
https://api.acme.ltd 4.3.2.1
ACTIVITY CALENDAR
APRIL 2022
S M T W T F S
27 28 29 30 31 1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
1 2 3 4 5 6 7
All testing activities took place against the staging environment. The web applications and their
underlying infrastructure were analyzed with the assistance of automated scanning tools as
well as subjected to manual review.
All work was carried out remotely from the offices of Blaze Information Security.
Application Mapping
This phase consists in browsing through the application, clicking on every working link,
filling in forms, and activating existing functionalities (password recovery, file uploads, user
registration, etc).
The objective of this step is to identify the attack surface of the application, to gain a
better understanding of its inner working, and to determine what are the main components,
its architecture, programming languages, frameworks, and technologies like back-end
databases, Web services, APIs, and more.
Functionality Mapping
Learning the application’s functionalities is key to achieving success in a penetration test.
The goal of this activity is to map all existing functionality and identify which ones are critical
according to the business context of the application. The results of this exercise will provide
the necessary background and guidance for focused security tests.
OWASP Top 10 checks
Blaze performs tests based on the widely-adopted OWASP Top 10 checklist, using it as
a reference to identify and quantify the risk posed by common security vulnerabilities
encountered in web application security assessments.
The penetration test of the platform had as its main goal the identification and exploitation
of the maximum number of vulnerabilities in order to assess its security posture when faced
against skilled and determined attackers. Thus, the applied methodology attempted to
enumerate all the cases of sensitive information exposure and unauthorized access
possibilities that would lead a would-be attacker into compromising the application itself or its
users.
This section summarizes the results of the application penetration testing assessment provided
by Blaze Information Security for ACME Ltd. concerning the assessment of the client, web
portal, manager and API applications.
The applications presented a security posture considered insufficient given the amount of
vulnerabilities discovered, as well as their severity and the risk these issues could pose to the
system and the data it handles.
Its vulnerable surface was considered broad, with nine vulnerabilities, one of them classified
as of critical severity and four of high risk. When combined, these issues could jeopardize the
security of the system and undermine the confidence users have in the platform.
The chart below illustrates the severity x quantity of the issues detected:
Blaze Information Security encountered several issues in the application, which may allow for
the following real-world scenarios to materialize:
A serious security issue was found in the user update mechanism. The user could change
another valid user’s e-mail address and password in the system simply by guessing the
predictable ID assigned to the user in question. This was demonstrated by changing the e-
mail address of another user to an attacker-controlled address and then triggering a password
reset. This leads to the takeover of the user account. Since user IDs are predictable, this can
lead to the mass takeover of user accounts across the ACME Portal.
Testing revealed the presence of a SQL injection vulnerability in the ACME Portal. This class
of security issue can affect the confidentiality and integrity of the underlying database. A
successful attack can compromise the records stored in the database, leading to its unintended
exposure.
Another issue related to weak access controls through the ACME Portal, the penetration testing
discovered that users could delete orders belonging to other individuals simply by changing the
ID of the order to another order not owned by them. Given that order IDs are predictable, this
can lead to the mass deletion of orders and cause a severe impact on the platform.
The following table summarizes the vulnerabilities found in the application, in line with CWE
whenever possible, presenting a reference regarding the impact of each vulnerability.
2 Stored Cross Site Scripting (XSS) CWE-79 Improper Neutralization of Input HIGH
During Web Page Generation (‘Cross-
site Scripting’)
5 Account hijacking via password reset CWE-20 Improper Input Validation HIGH
link poisoning
6 ACME Portal vulnerable to Server CWE-918 Server-Side Request Forgery (SSRF) MEDIUM
Side Request Forgery (SSRF)
8 Session cookie without secure flag CWE-614 Sensitive Cookie in HTTPS Session LOW
enabled Without ‘Secure’ Attribute
9 Email flood via password reset CWE-799 Improper Control of Interaction LOW
Frequency
First and foremost, all of the attack surfaces of the ACME web application were mapped in order
to identify all of its possible attack vectors. During this time, the security engineers interacted
with the available features so that they can familiarize themselves with the application and thus
identify attack paths and possible points of vulnerable functionality.
After feature mapping and functionality enumeration, the security engineers focused on attack
vectors that may arise from an unauthenticated perspective, i.e., adversaries that do not have
valid security credentials for the ACME application under the scope.
Focusing on attacks that can be conducted by authenticated users, the team attempted to
identify attack vectors that could negatively impact the system under the scope, thus assuming
a malicious registered and authorized user attacker/threat model. This phase is crucial in an
attempt to uncover possible access control & privilege escalation vulnerabilities, whereby a
malicious user A is able to obtain and/or alter sensitive data of a victim user B. The malicious
user A either seeks to elevate its privileges horizontally (victim user B possesses the very same
privilege level as malicious user A) or vertically (victim user B possesses an increased privilege
level than malicious user A).
Thus, for both authenticated & unauthenticated threat models, the following tests attempted to
uncover:
8.0 Vulnerabilities
8.1 Application Prone To Mass Account Hijack Vulnerability
Description
The ACME application allows citizens to manage multiple services online, such as enquiry of
construction permit, licenses, management of contracts and plans, commercial registration
and more.
This application was prone to a serious vulnerability that could lead to mass account hijacking.
The security issue in question allows any user to change the e-mail address of an already
registered account, effectively taking over the account given the ability to later issue a
password reset.
Below is the logged in user [email protected] and the original request, showing
the ID for this user:
Means that the user with the ID 62573 had his or her email changed to
An adversary can now issue a password reset request to the newly hijacked email and then log
in with the user account:
To cause a mass account hijack, an adversary can cycle through different IDs and change their
assigned email addresses to attacker-controlled email accounts, where they can later recover
the password by means of “Forgot password” functionality.
Reference
https://portswigger.net/web-security/access-control/idor
https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Direct_Object_Reference_Preve
ntion_Cheat_Sheet.html
Solution
Enforce correct access controls in the API endpoint when changing user’s passwords to make
sure users can only change their own credentials and nobody else’s.
Description
Just like most classic attacks against web application, Cross Site Scripting (XSS) happens due
to the lack of sanitization of user-supplied input and improper encoding of the output. The
objective of XSS is to inject HTML/JavaScript code in the application, which will later be echoed
back to the user and executed under the context of the victim’s web browser.
Stored Cross-Site Scripting, also known as Persistent Cross-Site Scripting, is considered even
more dangerous than its Reflected counterpart because malicious code inserted by the attacker
gets stored in the back-end of the application. Thus, the only interaction needed is to browse to
the affected functionality of the application for the code to be executed in the browser.
The team performed a series of automated and manual tests to verify the presence of the
vulnerability. The assessment revealed the firstName parameter in the information created
in the ACME application, but consumed as JSON by the endpoint CRMAjax/
ContactListByCustomerID:
Several threat scenarios can be leveraged via this vulnerability, such as: dissemination of
phishing campaigns, capture of sensitive information, session hijacking, and more.
Reference
https://owasp.org/www-community/attacks/xss/
https://cwe.mitre.org/data/definitions/79.html
Solution
The general recommendation against injection attacks is to perform sanitization and input
validation of every user-supplied data that will be consumed and processed by the application.
The steps of validation, sanitization and escaping should happen both in client and server side,
whenever possible.
In the specific case of Cross Site Scripting it is recommended to sanitize the input to avoid
insertion of HTML tags, like the characters “<” and “>” as well as their encoding variations. It’s
also important to remember that the output must be correctly escaped to their equivalent in
HTML entities:
Modern web application frameworks supports different ways to perform output escaping and
in many cases provides adequate levels of protection against Cross-Site Scripting out of the
box. Refer to the manual of the framework used in the project, if appropriate, to learn how to
leverage this security functionality.
Description
The ACME application allows citizens to manage multiple services online, such as enquiry of
construction permit, licenses, management of contracts and plans, commercial registration
and more. It seems like it is an old version of the Partner application.
This application was prone to a blind SQL injection attack in the columnName parameter in the
/ar/ajax/tableaction endpoint.
SQL injection is a vulnerability that occurs when user-supplied input is not properly sanitized
when constructing SQL queries and is directly sent to the database without any sort of
validation. SQL injection attacks are commonly used to gain unauthorized access to data stored
in the back-end database.
Blind SQL injection is a variation of the classic SQL injection attack. The main difference
between them lies in the fact that during the execution of a blind SQL injection the application
does not exhibit any error message originating from the database.
The query results are done via inferencing. This method consists in sending the application a
series of boolean queries and observe the responses in order to determine the existence of a
given piece of information.
In order to verify the presence of the vulnerability, the payload WAITFOR DELAY ‘0:0:30’— was
used; this makes the database “sleep” for 30 seconds if the attack is successful, as can be seen
below:
Another proof of the presence of the vulnerability was using master.dbo.xp_dirtree to attempt
to list the directories in a remote Windows share. The share had a DNS controlled by the team
and we could see DNS requests coming from ACME’s servers, as per the screenshot above.
The SQL injection in question is blind and more difficult to exploit than others, and in the
duration of the assessment it was not possible to fully exploit the vulnerability, but its presence
is more than confirmed with two different approaches.
If successfully exploited, the vulnerability is believed it can be used to extract the Bcrypt
password hashes and used in the pass-the-hash attacks described later in this report, as well
as altering and deleting information from the database.
Reference
https://owasp.org/www-community/attacks/Blind_SQL_Injection
https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Sec
urity_Testing/07-Input_Validation_Testing/05-Testing_for_SQL_Injection
https://portswigger.net/web-security/sql-injection/blind
Solution
The general recommendation against injection attacks is to perform sanitization and input
validation any user-supplied data that will be consumed and processed by the application,
especially in database queries. This validation and sanitization steps should happen both in
client and server side.
In the specific case of SQL injection vulnerabilities, the recommendation is to move away from
constructing dynamic queries with user-provided input and instead use prepared statements,
thereby separating code (the original intended query itself) from data (user-supplied).
Description
The application permits functionalities such as application for creation of a new industrial
facility.
The team spent large portions of the assessment looking for issues related to improper access
controls where a user could interfere or have unauthorized access to other user’s data.
The problem was found in the order functionality. Below we can see the Trading User B has an
order pending for approval:
Another user, User Test A, has two orders and will be used to delete the order for the User B:
When clicking on user’s Test A order, we can see what the request looks like:
We then replace the acmeOrderID from 207563 (the User Test A’s own order ID) to the ID
belonging to the user B, with ID 207565:
Then when going back to the profile of the user B, we see that the order was deleted and is no
longer present:
The attack means that one user A was able to delete orders belonging to user B simply by
replacing the ID of the order number.
This absence of access control checks may lead to deleting orders that do not belong to them,
causing loss of information.
By cycling through all possible IDs, this issue can affect all users in the platform.
Reference
https://portswigger.net/web-security/access-control/idor
https://www.oreilly.com/library/view/http-the-definitive/1565925092/ch12s03.html
https://owasp.org/www-project-top-ten/2017/A5_2017-Broken_Access_Control
Solution
To solve the mentioned problem, Blaze recommend ACME Ltd. to conduct a survey of
application access control requirements and document them in the application security policy,
as it is extremely important that each user can only access his own private information.
Description
Host header poisoning attack happens when the header sent by the user is not validated in the
server side.
It was possible to change the content of the "host” HTTP header when sending a request, forcing
the application to potentially interact with another domain.
This vector enables other types of attacks depending on the ecosystem surrounding the
application, such as: cache poisoning, password reset poisoning, injections of malicious code
into the server and others.
During the tests the team manipulated the “Host” header of the password reset functionality,
forcing the application to send a password redefinition link containing an attacker-controlled
host (in this case, managed.sa), as illustrated in the images below:
The victim then receives an email message containing a link to redefine the password. However,
when the victim clicks the link the attacker will get the password reset token, since the victim is
clicking in the link containing a malicious host instead of the original one as the images below
illustrate:
With the password reset token sent to the attacker domain, the adversary only needs to change
the malicious host to the original one, gaining full control over the victim’s account.
Then the password was successfully changed, as seen in the screenshot below:
Reference
https://www.acunetix.com/blog/articles/password-reset-poisoning/
https://owasp.org/www-project-web-security-testing-guide/latest/4-Web_Application_Sec
urity_Testing/07-Input_Validation_Testing/17-Testing_for_Host_Header_Injection
Solution
We recommend that the value of the Host header shouldn’t be used by the application to
generate the password reset link. If it must be used, it is very important that a very strict
whitelist is made for the application. It is also important to implement mechanisms that
perform proper validation of the request, whether it came from the original target host or not.
Description
Server Side Request Forgery (SSRF) is an attack that can abuse the functionality of the
application to access resources on its behalf. It works when an attacker-controlled URL, for
example, is passed to the application vulnerable to SSRF and it performs, for instance, a
request to fetch the resource located in the user-supplied URL.
Through SSRF an adversary can access services and systems behind firewalls as well as abuse
this issue to launch port scan attacks against internal
The example below shows a request to http://www.ipinfo.io a website that returns the source
IP address of the request. This website was chosen in order to illustrate the fact the source IP
requesting the resource is indeed the IP of the server where ACME Portal is running:
Request to ipinfo.io:
Blaze attempted to fetch the AWS environment metadata information endpoint in http://169.2
54.169.254 but was unable to receive a response that leaked secret information. This was due
to the fact the application was running inside a Docker container, which ultimately served as a
Depending on the environment more sophisticated attack scenarios, such as port scanning the
internal network, fetching data from an internal unprotected services like Redis, memcache, or
data from pages without authentication could be possible.
Despite the mitigations mentioned earlier, Blaze decided to rank this issue as medium risk
because the issue can be exploited by unauthenticated users.
Reference
https://www.owasp.org/index.php/Server_Side_Request_Forgery
https://portswigger.net/web-security/ssrf
https://cwe.mitre.org/data/definitions/918.html
Solution
8.7 Bcrypt Encrypted Credentials Being Sent As GET Request And Pass-the-Hash-
like Attack
Description
This behavior is considered insecure for two reasons. The first issue with this approach is
regarding the way the arguments are being sent to the web server, via GET requests. HTTP
requests of the verb GET are known for logging the requests on proxies, web server logs and
browser history.
The second issue is a Pass-the-Hash-like attack against ACME’s application. Just by simply
browsing the URL https://acme.ltd/auth/Old-Portal_Login?email=mallory.blazeinfosec@gmai
l.com&password=$2a$12$op9xfYM//48TZof1ZQ4q/AXK8UffXXXXXXXXXXXXXX.CChuR45wnGo1
xD the user gets logged in:
This behavior means that if an attacker breached the database, there would not even be the
need to waste resources to crack the Bcrypt hashes (known for being resistant to password
cracking), as they could be simply relayed to the “Old Login” functionality, which would log them
in.
The impact of this issue is twofold: one is regarding the logging of the Bcrypt hash in different
parts, whereas the second one is related to the fact the mere possession of the password hash,
with no need to spend computing power cracking them, would be enough to log into the user’s
session.
Reference
https://owasp.org/www-community/vulnerabilities/Information_exposure_through_quer
y_strings_in_url
https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure
https://cwe.mitre.org/data/definitions/598.html
https://searchsecurity.techtarget.com/definition/pass-the-hash-attack
Solution
Description
The attribute secure is an option that can be set in the cookie with the intent to prevent these
session tokens to traverse the network over non-HTTPS channels; that is, the cookie can be
only sent to the application when an encrypted HTTPS connection is established between the
browser and the application, thus avoiding session hijacking attacks via eavesdropping and/or
Man-in-the-Middle (MITM) attacks.
The image below shows the lack of the attribute secure in the session cookie:
Reference
https://owasp.org/www-community/controls/SecureCookieAttribute
https://portswigger.net/kb/issues/00500200_tls-cookie-without-secure-flag-set
https://resources.infosecinstitute.com/securing-cookies-httponly-secure-flags/
Solution
In order to solve the mentioned problem, reconfigure the session management functionality of
the application so session cookies can have the flag secure enabled.
Description
It was noticed the application does not implement CAPTCHA, API rate limit or other mechanisms
that prevents automated request for password reset.
As proof of concept, the following image illustrates an automated attack that sends requests to
reset a user’s password multiple times:
This behavior could be a minor annoyance if a malicious user decides to send multiple requests
to flood another user’s inbox.
Reference
http://projects.webappsec.org/w/page/13246938/Insufficient%20Anti-automation
http://projects.webappsec.org/w/page/13246915/Brute%20Force
Solution
9.0 Conclusion
The ultimate goal of a security assessment is to bring the opportunity to better illustrate the
risk of an organization and help make it understand and validate its security posture against
potential threats to its business.
The exercise showed that the security posture of the applications could be improved as they
contain a handful of security vulnerabilities. The most severe issues were related to the
absence of access control verification in key areas, such as in the user update mechanism –
which could be exploited by a user to change the email address of arbitrary users. This issue
could be easily used to take over all accounts in the application due to the ease of exploitation
and predictability of the user IDs.
Additionally, issues related to the absence of sanitization of user input combined with an
incorrect way to craft SQL queries, could lead to a scenario of blind SQL injection and
compromise of the database. Another noteworthy problem in the application was the lack of
sanitization and output escaping, as described in the stored cross-site scripting vulnerability.
The application was also prone to issues related to access control checks, where a user could
visualize tickets belonging to other users, where they originally did not have access to.
With that in mind, Blaze provide the following recommendations that we believe should be
adopted as next steps to further enhance the security posture of the organization:
Blaze Information Security would like to thank the team of ACME Ltd. for their support and
assistance during the entire engagement.
SEVERITY DESCRIPTION
CRITICAL This leads to the compromise of the system and the data it handles. Can be exploited by an unskilled
attacker using publicly available tools and exploits. Must be addressed immediately.
HIGH Usually leads to the compromise of the system and the data it handles.
MEDIUM Does not lead to the immediate compromise of the system but when chained with other issues can
bring serious security risks. Nevertheless, it is advisable to fix them accordingly.
LOW Do not pose an immediate risk and even when chained with other vulnerabilities are less likely to
cause serious impact.
INFO Does not pose an immediate risk, but requires continuous surveillance so that it doesn’t become a
liability through ill-use or future modifications in the system.
The following table lists the order in which the vulnerabilities should be fixed:
SEVERITY DESCRIPTION
MEDIUM Bcrypt encrypted credentials being sent as GET request and Pass-the-Hash-like attack
BRAZIL
+55 81 3071.7148
R. VISCONDE DE JEQUITINHONHA, 279,
EMPRESARIAL TANCREDO NEVES, OFFICE
701, RECIFE, PERNAMBUCO
PORTUGAL
+351 222 081 647
PRAÇA DO BOM SUCESSO, 131 - OFFICE 206,
4150-146, PORTO
WWW.BLAZEINFOSEC.COM
THIS DOCUMENT IS CLASSIFIED AS CONFIDENTIAL
[email protected]