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

file-upload-endpoint #10994

Open
mchklt opened this issue Oct 11, 2024 · 2 comments
Open

file-upload-endpoint #10994

mchklt opened this issue Oct 11, 2024 · 2 comments
Assignees

Comments

@mchklt
Copy link

mchklt commented Oct 11, 2024

Detects endpoints with forms that contain file upload functionality by identifying form tags with relevant attributes such as method, input, and button elements. This can potentially expose the application to risks like remote code execution, XSS attacks, or abuse of the server for hosting malicious files.

@mchklt
Copy link
Author

mchklt commented Oct 11, 2024

id: file-upload-endpoint
info:
  name: File Upload Endpoint Detection
  author: mchklt
  severity: info
  description: Detects endpoints with forms containing file upload fields by checking for form tags with method, input, and button elements.

requests:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "<form[^>]*method=[\"']?(post|POST)[\"']?[^>]*>"
          - "<input[^>]*type=[\"']?file[\"']?[^>]*>"
          - "<button[^>]*type=[\"']?submit[\"']?[^>]*>"
        condition: or
      - type: regex
        part: body
        regex:
          - "type=[\"'](file)[\"']"
          - "<button[^>]*type=[\"']?submit[\"']?[^>]*>"
        condition: or

@mchklt
Copy link
Author

mchklt commented Oct 11, 2024

This helped me identify endpoints containing file upload forms, leading to XSS via filename manipulation combined with CSRF .

For more details, you can read my article: Self-XSS via Filename + CSRF on Contact Us 'multipart/data' Form.

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

No branches or pull requests

2 participants