security: cover gh-token-monitor token persistence

This commit is contained in:
Affaan Mustafa
2026-05-17 17:46:35 -04:00
parent 6b282aaa43
commit 36d390aa7d
3 changed files with 37 additions and 3 deletions

View File

@@ -365,6 +365,18 @@ function run() {
});
})) passed++; else failed++;
if (test('rejects Mini Shai-Hulud gh-token-monitor token store when home scan is enabled', () => {
withFixture({
'home/.config/gh-token-monitor/token': 'redacted-token-placeholder',
}, rootDir => {
const homeDir = path.join(rootDir, 'home');
const result = scanSupplyChainIocs({ rootDir, home: true, homeDir });
assert.ok(result.findings.some(
finding => finding.indicator === '~/.config/gh-token-monitor/token',
));
});
})) passed++; else failed++;
if (test('rejects installed payload filenames in node_modules', () => {
withFixture({
'node_modules/@tanstack/react-router/router_init.js': '/* payload */',