2023-09-04 11:24:46 +00:00
|
|
|
id: missing-sri
|
2023-08-25 03:28:32 +00:00
|
|
|
info:
|
2023-09-04 11:24:46 +00:00
|
|
|
name: Missing Subresource Integrity
|
2023-08-25 03:28:32 +00:00
|
|
|
author: lucky0x0d,PulseSecurity.co.nz
|
|
|
|
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
|
|
|
|
metadata:
|
|
|
|
max-request: 1
|
2023-09-04 11:26:03 +00:00
|
|
|
tags: compliance,js,sri,misconfig
|
2023-08-25 03:28:32 +00:00
|
|
|
|
|
|
|
http:
|
|
|
|
- raw:
|
|
|
|
- |
|
|
|
|
GET / HTTP/1.1
|
|
|
|
Host: {{Hostname}}
|
|
|
|
|
|
|
|
redirects: true
|
|
|
|
max-redirects: 5
|
|
|
|
matchers-condition: and
|
|
|
|
matchers:
|
|
|
|
- type: xpath
|
|
|
|
part: body
|
|
|
|
xpath:
|
|
|
|
- "//script[contains(@src,'//') and not(contains(translate(@integrity,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),'^sha'))]"
|
|
|
|
|
|
|
|
- type: word
|
|
|
|
words:
|
|
|
|
- "text/html"
|
|
|
|
part: header
|
|
|
|
|
|
|
|
extractors:
|
|
|
|
- type: xpath
|
|
|
|
attribute: src
|
|
|
|
xpath:
|
|
|
|
- "//script[contains(@src,'//') and not(contains(translate(@integrity,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'),'^sha'))]"
|