hackmyagent 0.9.5 → 0.9.7
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/dist/attack/scanner.d.ts.map +1 -1
- package/dist/attack/scanner.js +6 -3
- package/dist/attack/scanner.js.map +1 -1
- package/dist/attack/types.d.ts +2 -0
- package/dist/attack/types.d.ts.map +1 -1
- package/dist/attack/types.js.map +1 -1
- package/dist/benchmarks/oasb-1.d.ts +1 -1
- package/dist/benchmarks/oasb-1.d.ts.map +1 -1
- package/dist/benchmarks/oasb-1.js +3 -3
- package/dist/benchmarks/oasb-1.js.map +1 -1
- package/dist/cli.js +221 -104
- package/dist/cli.js.map +1 -1
- package/dist/hardening/scanner.d.ts.map +1 -1
- package/dist/hardening/scanner.js +42 -15
- package/dist/hardening/scanner.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/registry/client.d.ts +1 -0
- package/dist/registry/client.d.ts.map +1 -1
- package/dist/registry/client.js +51 -5
- package/dist/registry/client.js.map +1 -1
- package/dist/scanner/external-scanner.js +1 -1
- package/dist/scanner/external-scanner.js.map +1 -1
- package/dist/semantic/deep-scan.js +1 -1
- package/dist/semantic/structural/credential-context.js +1 -1
- package/dist/semantic/structural/credential-context.js.map +1 -1
- package/dist/soul/scanner.d.ts +3 -1
- package/dist/soul/scanner.d.ts.map +1 -1
- package/dist/soul/scanner.js +48 -14
- package/dist/soul/scanner.js.map +1 -1
- package/dist/soul/templates.d.ts.map +1 -1
- package/dist/soul/templates.js +32 -0
- package/dist/soul/templates.js.map +1 -1
- package/package.json +1 -1
|
@@ -444,7 +444,9 @@ class HardeningScanner {
|
|
|
444
444
|
catch { }
|
|
445
445
|
try {
|
|
446
446
|
await fs.access(path.join(targetDir, '.claude'));
|
|
447
|
-
platforms.
|
|
447
|
+
if (!platforms.includes('claude-code')) {
|
|
448
|
+
platforms.push('claude-code');
|
|
449
|
+
}
|
|
448
450
|
}
|
|
449
451
|
catch { }
|
|
450
452
|
// OpenClaw detection
|
|
@@ -1750,15 +1752,24 @@ dist/
|
|
|
1750
1752
|
});
|
|
1751
1753
|
// DEP-004: Check for npm scripts security
|
|
1752
1754
|
let hasDangerousScripts = false;
|
|
1753
|
-
const
|
|
1755
|
+
const dangerousScriptRegexes = [
|
|
1756
|
+
/curl\b.*\|\s*sh/i, // curl ... | sh (with anything between)
|
|
1757
|
+
/curl\b.*\|\s*bash/i, // curl ... | bash
|
|
1758
|
+
/wget\b.*\|\s*sh/i, // wget ... | sh
|
|
1759
|
+
/wget\b.*\|\s*bash/i, // wget ... | bash
|
|
1760
|
+
/\beval\s*\(/, // eval(
|
|
1761
|
+
/\$\(curl\b/, // $(curl
|
|
1762
|
+
/\$\(wget\b/, // $(wget
|
|
1763
|
+
];
|
|
1764
|
+
const pkgJsonPath = path.join(targetDir, 'package.json');
|
|
1754
1765
|
try {
|
|
1755
|
-
const pkgJson = await fs.readFile(
|
|
1766
|
+
const pkgJson = await fs.readFile(pkgJsonPath, 'utf-8');
|
|
1756
1767
|
const pkg = JSON.parse(pkgJson);
|
|
1757
1768
|
if (pkg.scripts) {
|
|
1758
1769
|
for (const [, script] of Object.entries(pkg.scripts)) {
|
|
1759
1770
|
if (typeof script === 'string') {
|
|
1760
|
-
for (const pattern of
|
|
1761
|
-
if (
|
|
1771
|
+
for (const pattern of dangerousScriptRegexes) {
|
|
1772
|
+
if (pattern.test(script)) {
|
|
1762
1773
|
hasDangerousScripts = true;
|
|
1763
1774
|
break;
|
|
1764
1775
|
}
|
|
@@ -1775,6 +1786,7 @@ dist/
|
|
|
1775
1786
|
category: 'dependencies',
|
|
1776
1787
|
severity: 'critical',
|
|
1777
1788
|
passed: !hasDangerousScripts,
|
|
1789
|
+
file: hasDangerousScripts ? 'package.json' : undefined,
|
|
1778
1790
|
message: hasDangerousScripts
|
|
1779
1791
|
? 'Dangerous patterns in npm scripts (curl|sh, eval) - review carefully'
|
|
1780
1792
|
: 'npm scripts appear safe',
|
|
@@ -1885,15 +1897,29 @@ dist/
|
|
|
1885
1897
|
async checkProcessSecurity(targetDir, autoFix) {
|
|
1886
1898
|
const findings = [];
|
|
1887
1899
|
// PROC-001: Check for Dockerfile security
|
|
1900
|
+
// Search common Dockerfile locations
|
|
1888
1901
|
let hasSecureDockerfile = true;
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1902
|
+
let dockerfilePath;
|
|
1903
|
+
const dockerfileCandidates = [
|
|
1904
|
+
'Dockerfile',
|
|
1905
|
+
'Dockerfile.prod',
|
|
1906
|
+
'Dockerfile.production',
|
|
1907
|
+
'Dockerfile.dev',
|
|
1908
|
+
'docker/Dockerfile',
|
|
1909
|
+
];
|
|
1910
|
+
for (const candidate of dockerfileCandidates) {
|
|
1911
|
+
const candidatePath = path.join(targetDir, candidate);
|
|
1912
|
+
try {
|
|
1913
|
+
const dockerfile = await fs.readFile(candidatePath, 'utf-8');
|
|
1914
|
+
dockerfilePath = candidatePath;
|
|
1915
|
+
if (dockerfile.includes('USER root') || !dockerfile.includes('USER ')) {
|
|
1916
|
+
hasSecureDockerfile = false;
|
|
1917
|
+
}
|
|
1918
|
+
break; // Use the first Dockerfile found
|
|
1919
|
+
}
|
|
1920
|
+
catch {
|
|
1921
|
+
// File not found, try next candidate
|
|
1893
1922
|
}
|
|
1894
|
-
}
|
|
1895
|
-
catch {
|
|
1896
|
-
// No Dockerfile, that's fine
|
|
1897
1923
|
}
|
|
1898
1924
|
findings.push({
|
|
1899
1925
|
checkId: 'PROC-001',
|
|
@@ -1902,6 +1928,7 @@ dist/
|
|
|
1902
1928
|
category: 'process',
|
|
1903
1929
|
severity: 'high',
|
|
1904
1930
|
passed: hasSecureDockerfile,
|
|
1931
|
+
file: !hasSecureDockerfile && dockerfilePath ? path.relative(targetDir, dockerfilePath) : undefined,
|
|
1905
1932
|
message: hasSecureDockerfile
|
|
1906
1933
|
? 'Container runs as non-root user or no Dockerfile present'
|
|
1907
1934
|
: 'Dockerfile runs as root - add USER directive for non-root user',
|
|
@@ -5177,7 +5204,7 @@ dist/
|
|
|
5177
5204
|
message: `Skill matches known malicious pattern: "${matchedPattern}"`,
|
|
5178
5205
|
file: relativePath,
|
|
5179
5206
|
fixable: false,
|
|
5180
|
-
fix: 'Remove this skill
|
|
5207
|
+
fix: 'Remove this skill -- it matches known malware from the ClawHavoc campaign',
|
|
5181
5208
|
});
|
|
5182
5209
|
}
|
|
5183
5210
|
// SUPPLY-004: Version Drift Detection
|
|
@@ -5209,7 +5236,7 @@ dist/
|
|
|
5209
5236
|
message: `Known C2 IP address found: ${ip}`,
|
|
5210
5237
|
file: relativePath,
|
|
5211
5238
|
fixable: false,
|
|
5212
|
-
fix: 'Remove this skill
|
|
5239
|
+
fix: 'Remove this skill -- contains known malware C2 infrastructure',
|
|
5213
5240
|
});
|
|
5214
5241
|
break;
|
|
5215
5242
|
}
|
|
@@ -5227,7 +5254,7 @@ dist/
|
|
|
5227
5254
|
message: `Known malware filename referenced: "${filename}"`,
|
|
5228
5255
|
file: relativePath,
|
|
5229
5256
|
fixable: false,
|
|
5230
|
-
fix: 'Remove this skill
|
|
5257
|
+
fix: 'Remove this skill -- references known malware payload',
|
|
5231
5258
|
});
|
|
5232
5259
|
break;
|
|
5233
5260
|
}
|