agenteval-cli 0.8.11 → 0.8.13
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/bin/agenteval.js +12 -5
- package/package.json +1 -1
package/bin/agenteval.js
CHANGED
|
@@ -14,9 +14,9 @@ const VERSION_PATH = join(CACHE_DIR, ".version");
|
|
|
14
14
|
// SHA256 checksums injected by the release workflow.
|
|
15
15
|
// If all zeros, integrity check is skipped (dev/unreleased builds).
|
|
16
16
|
const CHECKSUMS = {
|
|
17
|
-
"agenteval-linux-x64": "
|
|
18
|
-
"agenteval-darwin-arm64": "
|
|
19
|
-
"agenteval-darwin-x64": "
|
|
17
|
+
"agenteval-linux-x64": "987939e22f97bc0277ea2f6d04820aefab3e264f62c15313660d8307c25bfe6d",
|
|
18
|
+
"agenteval-darwin-arm64": "1479ca198f85b43cddcda6b37baae39b5eb6c5e6e18ed143b9aace321aeb3ac2",
|
|
19
|
+
"agenteval-darwin-x64": "379293cb1d8db8e6f896c99d54974f5308a05613416aae6ca5abda888325ccf9",
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
function getPlatformKey() {
|
|
@@ -50,8 +50,15 @@ function download(url, maxRedirects) {
|
|
|
50
50
|
https.get(options, (res) => {
|
|
51
51
|
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
52
52
|
const location = res.headers.location;
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const ALLOWED_HOSTS = ["github.com", "objects.githubusercontent.com"];
|
|
54
|
+
try {
|
|
55
|
+
const redirectUrl = new URL(location || "");
|
|
56
|
+
if (redirectUrl.protocol !== "https:" || !ALLOWED_HOSTS.some(h => redirectUrl.hostname.endsWith(h))) {
|
|
57
|
+
reject(new Error(`Unsafe redirect to ${location}`));
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
} catch {
|
|
61
|
+
reject(new Error(`Invalid redirect URL: ${location}`));
|
|
55
62
|
return;
|
|
56
63
|
}
|
|
57
64
|
return download(location, maxRedirects - 1).then(resolve, reject);
|