Skip to content

Conversation

@ibrahmsql
Copy link
Contributor

New flags added:

  • --detailed-analysis: Performs deeper parameter analysis to uncover more XSS vectors
  • --fast-scan: Enables faster scanning, useful in CI/CD pipelines
  • --magic-char-test: Generates magic character payloads for manual analysis
  • --context-aware: Selects payloads intelligently based on the response context

Why these changes?

While testing large web applications recently, I noticed the existing parameter discovery wasn’t comprehensive enough. Especially in modern SPAs, some hidden parameters were being missed. The --detailed-analysis mode addresses this issue.

Also, for CI/CD workflows, getting quick feedback is important. The --fast-scan mode runs basic checks rapidly to support that need.

Technical details

  • Added the new flags in pkg/model/options.go
  • Updated CLI parsing in the cmd/ directory
  • Extended the core scanning logic in pkg/scanning/
  • Reused existing magic character utility functions instead of rewriting them

Testing

✅ All existing tests are passing
✅ Tested on real-world targets
✅ Backward compatibility is preserved
✅ No memory leaks found

These features are particularly helpful for improving penetration testing workflows. Looking forward to your feedback!

Closes: #695, #764

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @ibrahmsql, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces advanced XSS scanning features, including new CLI flags for detailed analysis, fast scanning, magic character testing, and context-aware payload selection. It enhances parameter discovery, adds WAF bypass payloads, and implements DOM XSS detection to improve penetration testing workflows.

Highlights

  • New Flags: Added new CLI flags: --detailed-analysis, --fast-scan, --magic-char-test, and --context-aware to enhance XSS scanning capabilities.
  • Enhanced Parameter Analysis: Implemented --detailed-analysis mode for deeper parameter analysis, addressing missed hidden parameters in modern SPAs (Issue #695).
  • Fast Scanning Mode: Introduced --fast-scan mode for faster scanning, optimizing concurrency and reducing checks, useful for CI/CD pipelines (Issue #764).
  • Magic Character Testing: Added --magic-char-test flag to generate magic character payloads for manual XSS analysis, including context-aware character generation.
  • WAF Bypass Payloads: Extended payload lists with WAF bypass techniques, modern HTML5 payloads, and CSP bypasses to improve XSS detection.
  • DOM XSS Analysis: Implemented DOM XSS detection by analyzing JavaScript code for source-to-sink flows and dangerous patterns.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The code changes introduce new flags for enhanced XSS scanning. I've identified a few areas for improvement, mainly concerning performance and a critical issue with random number generation. Addressing these will enhance the robustness and efficiency of these new features.

@ibrahmsql
Copy link
Contributor Author

all suggested improvements have been applied ready for further review

@codecov
Copy link

codecov bot commented Jun 28, 2025

@hahwul hahwul linked an issue Jun 28, 2025 that may be closed by this pull request
@hahwul hahwul added this to the v2.12.0 milestone Jun 28, 2025
@hahwul
Copy link
Owner

hahwul commented Jun 28, 2025

Hi @ibrahmsql
Thank you for your contribution!
I've reviewed the code and left a few comments with some suggestions. Please take a look when you have a moment.

Regarding the test code coverage, we can address that as a separate task later on.

Thanks again for your work on this!

@ibrahmsql
Copy link
Contributor Author

Hi @hahwul thanks for the review you mentioned you left a few comments but i couldn't locate them in the PR files or conversations could you please point me to those comments or re-post them if needed? thanks 🙂

@hahwul
Copy link
Owner

hahwul commented Jun 29, 2025

@ibrahmsql Oh, I'm so sorry. I didn't change the review status.

@ibrahmsql
Copy link
Contributor Author

Ekran Resmi 2025-06-29 22 29 53

Copy link
Owner

@hahwul hahwul left a comment

Choose a reason for hiding this comment

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

Great! 👍

@hahwul
Copy link
Owner

hahwul commented Jun 30, 2025

@ibrahmsql
I'll merge it! This change will be applied in the next release (v2.12).
Thank you very much for your contribution. Have a great day!

@hahwul hahwul merged commit 85d6a72 into hahwul:main Jun 30, 2025
5 of 6 checks passed
@ibrahmsql
Copy link
Contributor Author

super thanks for merging it nice to see it coming with v2.12 Let me know if I can help with anything else have a good day :)

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.

Checking for XSS from a Given URL List Only Improve parameter structure & Add magic character for Manual XSS Testing

2 participants