Skip to content

Create tes1t.html#26

Open
maekuss wants to merge 1 commit into
mainfrom
maekuss-patch-4
Open

Create tes1t.html#26
maekuss wants to merge 1 commit into
mainfrom
maekuss-patch-4

Conversation

@maekuss

@maekuss maekuss commented May 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

@hacktron-app

hacktron-app Bot commented May 22, 2026

Copy link
Copy Markdown

⏭️ Hacktron Security Check — Skipped

Reason: PR review limit reached for this billing period. Spillover billing is available for this org but is not enabled.

Ask your org owner to enable spillover billing on the billing page, or wait for the next billing cycle.

Go to: https://app.hacktron.ai/dscsdsdc/billing

@hacktron-app-stg hacktron-app-stg Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file

Severity Count
🔴 High 1

View full scan results

Comment thread tes1t.html

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 High: DOM-based XSS via insecure postMessage handling in tes1t.html

The application implements a message event listener in tes1t.html that fails to validate the event.origin property. It then directly takes the event.data and assigns it to the DOM using innerHTML. This allows an attacker to send a cross-origin message containing malicious HTML/JavaScript, which will be executed in the context of the page.

Evidence: tes1t.html:32-38

  • Line 32: window.addEventListener('message', (event) => {
  • Line 37: const incoming = typeof event.data === 'string' ? event.data : JSON.stringify(event.data);
  • Line 38: document.getElementById('output').innerHTML = incoming;
Steps to Reproduce
  1. Open tes1t.html in a browser.
  2. Open the browser console on a different origin (e.g., example.com).
  3. Execute: window.opener.postMessage('<img src=x onerror=alert(1)>', '*');
  4. An alert will trigger on the vulnerable page.
Fix with AI

Open in Cursor Open in Claude

Fix the following security vulnerability found by Hacktron.

File: tes1t.html
Severity: high

Vulnerability: DOM-based XSS via insecure postMessage handling in tes1t.html

Description:
The application implements a `message` event listener in `tes1t.html` that fails to validate the `event.origin` property. It then directly takes the `event.data` and assigns it to the DOM using `innerHTML`. This allows an attacker to send a cross-origin message containing malicious HTML/JavaScript, which will be executed in the context of the page.

Evidence: [tes1t.html:32-38](./testerror/tes1t.html:32-38)
- Line 32: `window.addEventListener('message', (event) => {`
- Line 37: `const incoming = typeof event.data === 'string' ? event.data : JSON.stringify(event.data);`
- Line 38: `document.getElementById('output').innerHTML = incoming;`

Proof of Concept:
1. Open `tes1t.html` in a browser.
2. Open the browser console on a different origin (e.g., `example.com`).
3. Execute: `window.opener.postMessage('<img src=x onerror=alert(1)>', '*');`
4. An alert will trigger on the vulnerable page.

Fix this vulnerability. Only change what's necessary - don't modify unrelated code.

Triage: Reply !fp <reason> (false positive), !valid (confirmed), or !accepted_risk <reason>. Reason is optional but improves future scans — e.g. !fp internal endpoint, not user-facing. Any other reply is saved as a triage note.

View finding in Hacktron

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

!valid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant