Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 18 additions & 8 deletions externally-connectable.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
id: externally-connectable
id: externally-connectable

info:
name: Externally Connectable
description: Specify external extensions and web pages the extension can exchange information with using the "externally_connectable" field. Limit connections to trusted sources.
name: Validate Externally Connectable
description: The externally_connectable field should be limited to only necessary and trusted domains.
author: nullenc0de
severity: medium

Expand All @@ -13,12 +13,22 @@ file:
matchers:
- type: regex
regex:
- "\"externally_connectable\"\\s*:\\s*{"
- "\"externally_connectable\"\\s*:\\s*\\"

extractors:
- type: regex
part: body
name: extracted_externally_connectable
regex:
- "\"externally_connectable\"\\s*:\\s*\\{[\\s\\S]*?\\}"
- "https://[^\\s'\"]+\\.example\\.com"
negative: true

extractors:
- type: regex
part: body
name: external_domains
regex:
- "\"externally_connectable\"\\s*:\\s*\\[([^\\]]+)\\]"

- type: regex
part: external_domains
name: extracted_domain
regex:
- "'(https://[^']+')"