Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the "Hidden Input Field Detection at Response Level (Passive)" Finding #231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LabMC
Copy link
Contributor

@LabMC LabMC commented Sep 27, 2024

Overview

  • CONTEXT: The purpose of this request is to update the "vulnerability-classes/injection/Detecting hidden input fields for XSS.bcheck" URL.
  • The current version of this bcheck only checks if <input> has type="hidden" as its very first attribute.
  • The current version of this bcheck also does not consider hidden fields via style="display: none;"
  • I've also provided additions to the detail & remediation text which provides an easy example for how users should test Hidden Input findings for XSS.

Ask: As this is a significant update to a pre-existing bcheck file, please let me know what the correct syntax is for multiple authors.

BCheck Contributions

  • BCheck compiles and executes as expected
  • BCheck contains appropriate metadata (name, version, author, description and appropriate tags)
  • Only .bcheck files have been added or modified
  • BCheck is in the appropriate folder
  • PR contains single or limited number of BChecks (Multiple PRs are preferred)
  • BCheck attempts to minimize false positives

- Updated regex to look for type="hidden" in an input field wherever it is in that hidden HTML element.
- Included detection for style="display: none;"
- Updated descriptions for detail & remediation.
Copy link
Contributor

@Hannah-PortSwigger Hannah-PortSwigger left a comment

Choose a reason for hiding this comment

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

Thank you for the additional validation that you've added to this BCheck.

We have some feedback around the styling of the issue detail and remediation advice to make this easier to read.


define:

# Issue Details:
Copy link
Contributor

Choose a reason for hiding this comment

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

Splitting the issue details and remediation advice into small chunks makes this code difficult to read. Can you please inline these into the report issue: block.

define:

# Issue Details:
id_01 = `- An '<input>' HTML field with the 'type="hidden"' or 'style="display: none;"' attribute has been detected.\n - This HTML field may be suseptible to XSS injections.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: susceptible

ir_06 = `\n > Libraries like 'DOMPurify', 'Helmet', & 'ESAPI' exist to automate detection of illicit characters & character types.`
ir_07 = `\n\n3. RESPONSE: If unapproved characters become detected, either 'REJECT this payload' immediately OR 'SANITIZE & REEVALUATE this payload'.`
ir_08 = `\n > REJECT: Deny data transferal from this payload & send a response which indicates that rejection has occurred.`
ir_09 = `\n > SANITIZE & REEVALUATE: Perform sanatization on non-whitelisted characters once to convert these values into safer alternatives.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: sanitization

ir_09a = ` Then reevaluate the payload for illicit characters again & REJECT this time if unsafe.`
ir_10 = `\n >> This practice should be tried if 'necessary' content appears expected to possess known-illicit characters (& this functionality cannot be rewritten).`
ir_11 = `\n\n4. ENCODE: If approved, this application must encode all HTML metacharacters contained within user input whenever this content would be copied directly into an HTTP webpage.`
ir_12 = `\n > For example: '<' becomes '&lt;', '>' becomes '&gt;', '&' becomes '&amp', '"' becomes '&quot', & etcetera.`
Copy link
Contributor

Choose a reason for hiding this comment

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

Small typo: No need for the "& etcetera." - this can just be "etc." or "et cetera."

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

Successfully merging this pull request may close these issues.

2 participants