z-schema 12.0.3 → 12.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -6
- package/bin/z-schema +6 -1
- package/cjs/index.js +1015 -12
- package/dist/schema-compiler.js +25 -10
- package/dist/utils/schema-regex.js +11 -2
- package/package.json +5 -2
- package/src/schema-compiler.ts +30 -10
- package/src/utils/schema-regex.ts +13 -2
- package/umd/ZSchema.js +1015 -12
- package/umd/ZSchema.min.js +1 -1
package/README.md
CHANGED
|
@@ -280,17 +280,17 @@ Big thanks to:
|
|
|
280
280
|
</tr>
|
|
281
281
|
<tr>
|
|
282
282
|
<td align="center">
|
|
283
|
-
<a href="https://github.com/
|
|
284
|
-
<img src="https://avatars.githubusercontent.com/u/
|
|
283
|
+
<a href="https://github.com/toofishes">
|
|
284
|
+
<img src="https://avatars.githubusercontent.com/u/265817?v=4" width="100;" alt="toofishes"/>
|
|
285
285
|
<br />
|
|
286
|
-
<sub><b>
|
|
286
|
+
<sub><b>Dan McGee</b></sub>
|
|
287
287
|
</a>
|
|
288
288
|
</td>
|
|
289
289
|
<td align="center">
|
|
290
|
-
<a href="https://github.com/
|
|
291
|
-
<img src="https://avatars.githubusercontent.com/u/
|
|
290
|
+
<a href="https://github.com/epoberezkin">
|
|
291
|
+
<img src="https://avatars.githubusercontent.com/u/2769109?v=4" width="100;" alt="epoberezkin"/>
|
|
292
292
|
<br />
|
|
293
|
-
<sub><b>
|
|
293
|
+
<sub><b>Evgeny</b></sub>
|
|
294
294
|
</a>
|
|
295
295
|
</td>
|
|
296
296
|
<td align="center">
|
package/bin/z-schema
CHANGED
|
@@ -131,7 +131,12 @@ function validateWithAutomaticDownloads(filePath, data, schema, callback) {
|
|
|
131
131
|
console.error('Requests to private/internal addresses are not allowed: ' + url);
|
|
132
132
|
process.exit(1);
|
|
133
133
|
}
|
|
134
|
-
request(parsedUrl, function (response) {
|
|
134
|
+
request(parsedUrl, { maxRedirects: 0 }, function (response) {
|
|
135
|
+
// Reject redirects to prevent SSRF via open redirect (CWE-918)
|
|
136
|
+
if (response.statusCode >= 300 && response.statusCode < 400) {
|
|
137
|
+
console.error('Redirects are not followed for security reasons: ' + url);
|
|
138
|
+
process.exit(1);
|
|
139
|
+
}
|
|
135
140
|
var body = '';
|
|
136
141
|
response.on('data', function (chunk) {
|
|
137
142
|
body += chunk;
|