Skip to content

Commit dc8caf4

Browse files
committed
Harden vendor URL validation and lock workflow permissions
Require HTTPS-only website/social links, set workflow token permissions to read-only, and pin devalue to a patched version to remove the reported vulnerability.
1 parent 134d3a2 commit dc8caf4

6 files changed

Lines changed: 25 additions & 12 deletions

File tree

.github/workflows/sync-vendors.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- "logos/**"
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
1114
concurrency:
1215
group: sync-vendors-main
1316
cancel-in-progress: false

.github/workflows/validate-vendor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- "logos/**"
99
- "scripts/validate-all.mjs"
1010

11+
permissions:
12+
contents: read
13+
1114
jobs:
1215
validate:
1316
name: Validate schema, slug & logo

VENDOR_GUIDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Paste this example, then replace the sample details with your own shop details:
9494
A few notes:
9595
- `description` is optional, but recommended
9696
- leave `active` as `true`
97-
- for social links, use the full URL or leave the field empty: `""`
97+
- for website and social links, use full HTTPS URLs or leave social fields empty: `""`
9898

9999
Valid regions:
100100
`Europe` · `North America` · `South America` · `Asia Pacific` · `Middle East` · `Africa` · `India`

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
"dependencies": {
1111
"framer-api": "0.1.1"
1212
},
13+
"overrides": {
14+
"devalue": "^5.6.4"
15+
},
1316
"devDependencies": {
1417
"ajv": "^8.17.1",
1518
"ajv-formats": "^3.0.1"

vendors/_schema.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"website": {
2828
"type": "string",
2929
"format": "uri",
30-
"description": "Full URL of the vendor's website"
30+
"pattern": "^https://",
31+
"description": "Full HTTPS URL of the vendor's website"
3132
},
3233
"region": {
3334
"type": "string",
@@ -67,11 +68,12 @@
6768
"additionalProperties": false,
6869
"properties": {
6970
"x": {
70-
"description": "Full URL to X (Twitter) profile, or empty string to omit",
71+
"description": "Full HTTPS URL to X (Twitter) profile, or empty string to omit",
7172
"oneOf": [
7273
{
7374
"type": "string",
74-
"format": "uri"
75+
"format": "uri",
76+
"pattern": "^https://"
7577
},
7678
{
7779
"type": "string",
@@ -80,11 +82,12 @@
8082
]
8183
},
8284
"instagram": {
83-
"description": "Full URL to Instagram profile, or empty string to omit",
85+
"description": "Full HTTPS URL to Instagram profile, or empty string to omit",
8486
"oneOf": [
8587
{
8688
"type": "string",
87-
"format": "uri"
89+
"format": "uri",
90+
"pattern": "^https://"
8891
},
8992
{
9093
"type": "string",
@@ -93,11 +96,12 @@
9396
]
9497
},
9598
"youtube": {
96-
"description": "Full URL to YouTube channel, or empty string to omit",
99+
"description": "Full HTTPS URL to YouTube channel, or empty string to omit",
97100
"oneOf": [
98101
{
99102
"type": "string",
100-
"format": "uri"
103+
"format": "uri",
104+
"pattern": "^https://"
101105
},
102106
{
103107
"type": "string",

0 commit comments

Comments
 (0)