Download PDF
Sentinel · www.genehack.co.jp

Example Inc.

White-Box (Source Code) Review
Web Application Penetration Test
Date2026-10-13
Version1.0
Overall riskCritical
CONFIDENTIAL
DEMO REPORT
About this demo reportThis report was produced from a test application for demonstration purposes. All company names, data and findings are sample content; no real customer data or production systems are included.
Prepared by GeneHack inc.© 2026 · All rights reserved.
White-Box (Source Code) Review
Source code analysis
Confidential · Example Inc.

1. Executive Summary

This summary is written for both business and technical readers.

This White-Box (Source Code) Review of the Example Inc. web application identified 6 findings (1 critical, 4 high and 1 medium). Exploitation could lead to account and system compromise and exposure of customer data. The overall risk is rated Critical. Remediation should prioritise the highest-severity issues first.

1Critical
4High
1Medium
0Low
Findings by severity

2. Scope & Methodology

Test parameters

Testing periodOct 13, 2026 — Oct 17, 2026
Out of scopeSource code of third-party libraries and dependency packages.

Source code

SourceArchive
Archive filejuice-shop.zip
Versionv13.0.0
SHA-2560714c400584bd81d4a77cd65b9673379e8df4affd964a3d5dba141028e5dace2
Received2026-10-13
LanguagesTypeScript (52%), JavaScript (29%), SCSS (7%), HTML (6%), YAML (4%), Terraform (1%)
Volume755 files, 81 261 lines of code
Includedserver.ts
frontend/
data/
routes/
lib/
models/
views/
Excludedtest/
Review depthFull review
Focus areas
Injection
SQLiXXESSTICRLF injection
Cross-site attacks
XSS (reflected, stored, DOM)CSRFOpen redirect
Auth & access control
IDORBroken access controlAuthentication weaknessesJWT vulnerabilitiesMass assignment
Server-side
SSRFRCEPath traversalLFI / RFIFile upload
Config & exposure
Security misconfigurationSensitive data exposureInfo disclosure (stack traces, .git, backups)
Logic & modern stacks
Business logic flawsPrototype pollution

Methodology

Automated analysis of the provided source code with expert manual verification of every finding; false positives were eliminated.

3. Findings Overview

IDFindingSeverityStatus
F1SQL Injection (Authentication Bypass)CriticalConfirmed
F2NoSQL InjectionHighConfirmed
F3Insecure Direct Object Reference (IDOR)HighConfirmed
F4Broken AuthenticationHighConfirmed
F5Mass AssignmentHighConfirmed
F6Sensitive Data Exposure — Directory Listing, Backups & LogsMediumConfirmed

4. Detailed Findings

F1

Critical SQL Injection (Authentication Bypass)

Affected code
routes/login.ts:34
CWE
CWE-89
Description

The login handler concatenates the submitted email address directly into the SQL statement, allowing an attacker to alter the query's logic.

Business impact

Authentication can be bypassed entirely: an attacker can log in as an administrator without valid credentials and access all customer and order data.

Root cause (code)

routes/login.ts:34 concatenates the email field as a string and does not use a parameterized query (placeholder).

Steps to reproduce
  1. Send the request below.
  2. The server returns 200 and a valid authentication token.
  3. The token can be used as Authorization: Bearer to access administrative functionality.
Proof of Concept
POST /rest/user/login HTTP/1.1
Host: shop.example-inc.jp
Content-Type: application/json

{"email":"' OR 1=1--","password":"x"}
Remediation
Use parameterized queries (placeholders) or ORM binding, and never concatenate user input into SQL statements. Also validate input and use a least-privilege database account.
F2

High NoSQL Injection

Affected code
routes/updateProductReviews.ts:17-19
CWE
CWE-943
Description

User input reaches a NoSQL query as an operator/object, changing the query semantics.

Business impact

Authentication bypass, data disclosure, and in $where contexts server-side code execution.

Root cause (code)

At routes/updateProductReviews.ts:17, { _id: req.body.id } is passed straight to update, and line 19 sets { multi: true }. Supplying an id of {"$ne":-1} matches every document, and no ownership check is performed.

Steps to reproduce
  1. Log in as an ordinary user and obtain a token.
  2. Send the request below, setting id to an operator object.
  3. Confirm that all reviews have been overwritten.
Proof of Concept
PATCH /rest/products/reviews HTTP/1.1
Host: shop.example-inc.jp
Authorization: Bearer <TOKEN>
Content-Type: application/json

{"id":{"$ne":-1},"message":"pwned"}
Remediation
Cast input to the expected type, reject objects/operators, and never build $where from user input.
F3

High Insecure Direct Object Reference (IDOR)

Affected code
routes/basket.ts:18
CWE
CWE-639
Description

An object is returned by its identifier without verifying it belongs to the current user.

Business impact

Unauthorized access to other users' data by enumerating identifiers.

Root cause (code)

routes/basket.ts retrieves the basket by the id from the URL with no ownership check (only authentication is required).

Steps to reproduce
  1. Log in as an ordinary user.
  2. Request an ID other than your own (/rest/basket/2).
  3. Another user's basket contents are returned.
Proof of Concept
GET /rest/basket/2 HTTP/1.1
Host: shop.example-inc.jp
Authorization: Bearer <TOKEN>
Remediation
Enforce object-level authorization: verify the resource owner matches the session user.
F4

High Broken Authentication

Affected code
routes/changePassword.ts:39
CWE
CWE-287
Description

Weaknesses in the authentication flow allow bypass or account takeover.

Business impact

Account takeover and unauthorized access to user functionality and data.

Root cause (code)

changePassword.ts validates the current password only inside the "if (currentPassword && ...)" branch, so validation is skipped when it is not provided.

Steps to reproduce
  1. With a valid session, send the request without the current parameter.
  2. The response confirms that the password has been changed.
  3. You can log in with the new password.
Proof of Concept
GET /rest/user/change-password?new=NewPass123&repeat=NewPass123 HTTP/1.1
Host: shop.example-inc.jp
Authorization: Bearer <TOKEN>
Remediation
Verify credentials server-side on every sensitive action, enforce MFA, and protect against CSRF.
F5

High Mass Assignment

Affected code
server.ts:382, models/user.ts:76-98
CWE
CWE-915
Description

The API binds request fields to the model without a whitelist, allowing privileged fields to be set.

Business impact

Privilege escalation (e.g. registering as an administrator) or tampering with protected attributes.

Root cause (code)

server.ts exposes POST /api/Users as a registration endpoint with no field filtering, and models/user.ts exposes role as a writable attribute whose validation permits 'admin'. As a result, a client-supplied role is accepted as-is.

Steps to reproduce
  1. As an anonymous user, send the request below with "role":"admin" in the request body.
  2. The account is created with administrator privileges.
  3. Log in with the newly created account — it has administrator privileges.
Proof of Concept
POST /api/Users HTTP/1.1
Host: shop.example-inc.jp
Content-Type: application/json

{"email":"attacker@evil.test","password":"x","role":"admin"}
Remediation
Bind only an explicit allowlist of fields; never accept role/privilege attributes from the client.
F6

Medium Sensitive Data Exposure — Directory Listing, Backups & Logs

Affected code
server.ts:288-289, server.ts:300-302, routes/logfileServer.ts:14
CWE
CWE-548
Description

Directory listing is enabled, exposing backup files and server logs that contain sensitive information. The exposure of source/configuration backups and access logs (tokens, IP addresses) significantly eases subsequent attacks.

Business impact

Exposed backup files and server logs may disclose sensitive information, including authentication tokens and source code, enabling unauthorized access and further attacks.

Root cause (code)

serveIndex is enabled on /ftp and /support/logs, and sensitive files are served by name.

Steps to reproduce
  1. Request /ftp to obtain a listing of the public directory.
  2. Request /support/logs/ to obtain a listing of the log files.
  3. Download a log file from the listing and inspect it for tokens and client IP addresses.
Proof of Concept
GET /ftp HTTP/1.1
Host: shop.example-inc.jp


GET /support/logs/ HTTP/1.1
Host: shop.example-inc.jp
Remediation
Disable directory listing, remove backups from the public area, and apply access control and rotation to logs.

5. Remediation Roadmap

Recommended remediation order, highest business risk first:

Immediately

  • F1 — SQL Injection (Authentication Bypass)

Short term

  • F2 — NoSQL Injection
  • F3 — Insecure Direct Object Reference (IDOR)
  • F4 — Broken Authentication
  • F5 — Mass Assignment

Planned

  • F6 — Sensitive Data Exposure — Directory Listing, Backups & Logs

6. Appendix

Approach & standards

The assessment combined automated source-code analysis with expert manual verification. It references the OWASP Top 10 as a guiding framework; every reported issue was manually verified and confirmed in the code, and false positives were eliminated.

Disclaimer

This report is confidential and intended solely for the named client. Findings reflect the state of the application at the time of testing.
Demo report notice
This is a demonstration report generated from a test application. It contains sample information only, and no real customer or company data has been published here.