External Dependency Supply Chain Risk
An authentication app loaded a JavaScript dependency from an S3-compatible bucket that allowed unauthorised writes. I confirmed the bucket was world-writeable, demonstrated that a modified dependency could intercept credentials, and identified the controls to protect dependency integrity.
Status: ASSESSED · VERIFIED
TOOLS
Objective
I set out to assess whether externally hosted application dependencies could be modified without authorisation, and whether a compromised dependency could intercept user credentials.
Scenario
A web application loaded its authentication logic from a JavaScript file hosted in an S3-compatible storage bucket. The bucket's access controls had not been reviewed since deployment. I wanted to check whether an unauthorised user could overwrite the dependency and what the impact would be on the application's users.
What I found
FINDING 01 (CRITICAL): DEPENDENCY BUCKET ALLOWED UNAUTHORISED WRITES
The S3-compatible bucket hosting the auth.js dependency accepted PUT requests without authentication. Any user who could discover the bucket could overwrite its contents.
Bucket: libraries
PUT test: HTTP 200 OK (unauthorised write accepted)
Dependency: auth.jsFINDING 02 (CRITICAL): MODIFIED DEPENDENCY INTERCEPTED CREDENTIALS
After confirming the write access, I replaced the dependency with a version that sent submitted form data to an external host. The application loaded the modified file and user credentials were captured.
Modified dependency: auth.js (credential exfiltration added)
Credentials captured: Username and password from login form
Application impact: Every user who authenticated was affectedThe intercepted credentials were valid and could be used to authenticate to the application. The threat group associated with this class of attack in the scenario was MageCart.
What I did
- Inspected the application
I identified that the authentication page loaded
auth.jsfrom an external S3-compatible bucket. - Tested bucket permissions
A PUT request to the bucket returned HTTP 200, confirming world-writeable access.
- Confirmed the impact
A modified version of the dependency intercepted credentials submitted through the login form.
- Validated the captured credentials
The intercepted credentials worked against the application, confirming the full attack path.
EVIDENCE
# Dependency hosting assessment
Bucket: libraries (S3-compatible)
Write test: PUT request accepted without authentication
Dependency: auth.js loaded by authentication page
Impact: Credential interception confirmedValidation
The modified dependency successfully intercepted credentials, and the captured credentials authenticated to the application. The full path from unauthorised bucket write to credential compromise was confirmed.
Before and after
| CONTROL | BEFORE | AFTER |
|---|---|---|
| Bucket write access | World-writeable | Exposure documented; lockdown recommended |
| Dependency integrity | No verification | Recommended: SRI hashes |
| Authentication page | Loaded external JS without checks | Risk documented |
| Credential protection | None beyond HTTPS | Recommended: integrity checks + monitoring |
| Bucket access control | Open | Recommended: read-only for consumers |
What I recommend
- 01Restrict bucket write access to authorised deployment pipelines only; consumers should have read-only access.
- 02Use Subresource Integrity (SRI) hashes on all externally loaded scripts so the browser rejects modified files.
- 03Host critical dependencies from infrastructure you control rather than shared or third-party buckets.
- 04Monitor dependency hosting for unexpected changes or unauthorised writes.
- 05Review all externally hosted dependencies and their access controls as part of supply chain security.
“A dependency does not need to contain a vulnerability to become a security risk. If an attacker can modify a trusted dependency's distribution point, they can potentially compromise every application that consumes it.”
SKILLS IT PROVES
- Software Supply Chain Security
- Dependency Management
- Vulnerability Assessment
- Web Application Security
- JavaScript Security
- Cloud Storage Security
- Access Control
- Integrity Validation
- Secure Configuration Management
- DevSecOps