nuclei-templates/http/misconfiguration/missing-sri.yaml

42 lines
1.4 KiB
YAML
Raw Normal View History

id: missing-sri
2023-10-14 11:27:55 +00:00
info:
name: Missing Subresource Integrity
author: lucky0x0d,PulseSecurity.co.nz,sullo
severity: info
description: |
Checks if script tags within the HTML response have Subresource Integrity implemented via the integrity attribute.
reference:
- https://cheatsheetseries.owasp.org/cheatsheets/Third_Party_Javascript_Management_Cheat_Sheet.html#subresource-integrity
- https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity
metadata:
max-request: 1
2023-09-04 11:26:03 +00:00
tags: compliance,js,sri,misconfig
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
redirects: true
max-redirects: 5
2023-10-14 11:27:55 +00:00
matchers-condition: and
matchers:
- type: xpath
part: body
xpath:
2024-08-23 14:49:00 +00:00
- "//script[contains(@src,'//') and not(matches(translate(@integrity,'ABCDEFGHIJKLMNOPQRSTUVWXYZ+/-=','abcdefghijklmnopqrstuvwxyz+/-='), '^sha(256|384|512)-'))]"
- type: word
words:
- "text/html"
part: header
extractors:
- type: xpath
attribute: src
xpath:
2024-08-23 14:49:00 +00:00
- "//script[contains(@src,'//') and not(matches(translate(@integrity,'ABCDEFGHIJKLMNOPQRSTUVWXYZ+/-=','abcdefghijklmnopqrstuvwxyz+/-='), '^sha(256|384|512)-'))]"
2024-09-05 04:40:10 +00:00
# digest: 4a0a004730450221009006d0edc711f674db98cd8d397c38ad75ace6acd39c2d0d6af8264ba999218702206ff23f350934532e43608643107931a06f89cf80d013269aabe053b04b87ee77:922c64590222798bb761d5b6d8e72950