@ai-dossier/core 1.3.0 → 1.3.2
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/coherence/checks.d.ts +13 -0
- package/dist/coherence/checks.d.ts.map +1 -0
- package/dist/coherence/checks.js +239 -0
- package/dist/coherence/checks.js.map +1 -0
- package/dist/coherence/index.d.ts +47 -0
- package/dist/coherence/index.d.ts.map +1 -0
- package/dist/coherence/index.js +89 -0
- package/dist/coherence/index.js.map +1 -0
- package/dist/coherence/types.d.ts +70 -0
- package/dist/coherence/types.d.ts.map +1 -0
- package/dist/coherence/types.js +11 -0
- package/dist/coherence/types.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/security-scanner/code-block-context.d.ts +24 -0
- package/dist/security-scanner/code-block-context.d.ts.map +1 -0
- package/dist/security-scanner/code-block-context.js +68 -0
- package/dist/security-scanner/code-block-context.js.map +1 -0
- package/dist/security-scanner/index.d.ts +21 -0
- package/dist/security-scanner/index.d.ts.map +1 -0
- package/dist/security-scanner/index.js +92 -0
- package/dist/security-scanner/index.js.map +1 -0
- package/dist/security-scanner/match-utils.d.ts +21 -0
- package/dist/security-scanner/match-utils.d.ts.map +1 -0
- package/dist/security-scanner/match-utils.js +40 -0
- package/dist/security-scanner/match-utils.js.map +1 -0
- package/dist/security-scanner/registry.d.ts +11 -0
- package/dist/security-scanner/registry.d.ts.map +1 -0
- package/dist/security-scanner/registry.js +79 -0
- package/dist/security-scanner/registry.js.map +1 -0
- package/dist/security-scanner/rules/agent-hijacking.d.ts +3 -0
- package/dist/security-scanner/rules/agent-hijacking.d.ts.map +1 -0
- package/dist/security-scanner/rules/agent-hijacking.js +56 -0
- package/dist/security-scanner/rules/agent-hijacking.js.map +1 -0
- package/dist/security-scanner/rules/dangerous-execution.d.ts +3 -0
- package/dist/security-scanner/rules/dangerous-execution.d.ts.map +1 -0
- package/dist/security-scanner/rules/dangerous-execution.js +86 -0
- package/dist/security-scanner/rules/dangerous-execution.js.map +1 -0
- package/dist/security-scanner/rules/data-exfiltration.d.ts +3 -0
- package/dist/security-scanner/rules/data-exfiltration.d.ts.map +1 -0
- package/dist/security-scanner/rules/data-exfiltration.js +61 -0
- package/dist/security-scanner/rules/data-exfiltration.js.map +1 -0
- package/dist/security-scanner/rules/index.d.ts +12 -0
- package/dist/security-scanner/rules/index.d.ts.map +1 -0
- package/dist/security-scanner/rules/index.js +30 -0
- package/dist/security-scanner/rules/index.js.map +1 -0
- package/dist/security-scanner/rules/prompt-injection.d.ts +3 -0
- package/dist/security-scanner/rules/prompt-injection.d.ts.map +1 -0
- package/dist/security-scanner/rules/prompt-injection.js +56 -0
- package/dist/security-scanner/rules/prompt-injection.js.map +1 -0
- package/dist/security-scanner/rules/supply-chain.d.ts +3 -0
- package/dist/security-scanner/rules/supply-chain.d.ts.map +1 -0
- package/dist/security-scanner/rules/supply-chain.js +61 -0
- package/dist/security-scanner/rules/supply-chain.js.map +1 -0
- package/dist/security-scanner/rules/unicode-attacks.d.ts +3 -0
- package/dist/security-scanner/rules/unicode-attacks.d.ts.map +1 -0
- package/dist/security-scanner/rules/unicode-attacks.js +83 -0
- package/dist/security-scanner/rules/unicode-attacks.js.map +1 -0
- package/dist/security-scanner/rules/url-threats.d.ts +3 -0
- package/dist/security-scanner/rules/url-threats.d.ts.map +1 -0
- package/dist/security-scanner/rules/url-threats.js +82 -0
- package/dist/security-scanner/rules/url-threats.js.map +1 -0
- package/dist/security-scanner/rules/xss-html-injection.d.ts +3 -0
- package/dist/security-scanner/rules/xss-html-injection.d.ts.map +1 -0
- package/dist/security-scanner/rules/xss-html-injection.js +82 -0
- package/dist/security-scanner/rules/xss-html-injection.js.map +1 -0
- package/dist/security-scanner/types.d.ts +45 -0
- package/dist/security-scanner/types.d.ts.map +1 -0
- package/dist/security-scanner/types.js +3 -0
- package/dist/security-scanner/types.js.map +1 -0
- package/dist/trace-recorder.d.ts +45 -0
- package/dist/trace-recorder.d.ts.map +1 -0
- package/dist/trace-recorder.js +43 -0
- package/dist/trace-recorder.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Utilities for detecting whether content appears inside fenced code blocks.
|
|
4
|
+
*
|
|
5
|
+
* Findings inside code blocks are downgraded in confidence because the content
|
|
6
|
+
* is illustrative/documentary rather than executable instructions.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.parseCodeBlockRanges = parseCodeBlockRanges;
|
|
10
|
+
exports.isLineInCodeBlock = isLineInCodeBlock;
|
|
11
|
+
exports.getLineNumber = getLineNumber;
|
|
12
|
+
/**
|
|
13
|
+
* Parse all fenced code block ranges from a markdown body.
|
|
14
|
+
* Supports ``` and ~~~ fences per CommonMark spec.
|
|
15
|
+
*/
|
|
16
|
+
function parseCodeBlockRanges(body) {
|
|
17
|
+
const lines = body.split('\n');
|
|
18
|
+
const ranges = [];
|
|
19
|
+
let openFenceLine = null;
|
|
20
|
+
let openFenceChar = null;
|
|
21
|
+
for (let i = 0; i < lines.length; i++) {
|
|
22
|
+
const line = lines[i];
|
|
23
|
+
const trimmed = line.trimStart();
|
|
24
|
+
// Check for opening or closing fence
|
|
25
|
+
const backtickMatch = trimmed.match(/^(`{3,})/);
|
|
26
|
+
const tildeMatch = trimmed.match(/^(~{3,})/);
|
|
27
|
+
const fenceMatch = backtickMatch || tildeMatch;
|
|
28
|
+
if (fenceMatch) {
|
|
29
|
+
const fenceChar = backtickMatch ? '`' : '~';
|
|
30
|
+
const fenceLen = fenceMatch[1].length;
|
|
31
|
+
if (openFenceLine === null) {
|
|
32
|
+
// Opening a new code block
|
|
33
|
+
openFenceLine = i + 1; // 1-based
|
|
34
|
+
openFenceChar = fenceChar;
|
|
35
|
+
}
|
|
36
|
+
else if (fenceChar === openFenceChar && fenceLen >= 3) {
|
|
37
|
+
// Closing the current code block (must use same fence character)
|
|
38
|
+
ranges.push({ startLine: openFenceLine, endLine: i + 1 });
|
|
39
|
+
openFenceLine = null;
|
|
40
|
+
openFenceChar = null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// If a fence was never closed, treat everything from the opening to EOF as a code block
|
|
45
|
+
if (openFenceLine !== null) {
|
|
46
|
+
ranges.push({ startLine: openFenceLine, endLine: lines.length });
|
|
47
|
+
}
|
|
48
|
+
return ranges;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check whether a given 1-based line number falls inside any fenced code block.
|
|
52
|
+
*/
|
|
53
|
+
function isLineInCodeBlock(line, ranges) {
|
|
54
|
+
return ranges.some((r) => line >= r.startLine && line <= r.endLine);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get the 1-based line number for a character offset in a string.
|
|
58
|
+
*/
|
|
59
|
+
function getLineNumber(text, offset) {
|
|
60
|
+
let line = 1;
|
|
61
|
+
for (let i = 0; i < offset && i < text.length; i++) {
|
|
62
|
+
if (text[i] === '\n') {
|
|
63
|
+
line++;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return line;
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=code-block-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-context.js","sourceRoot":"","sources":["../../src/security-scanner/code-block-context.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAWH,oDAsCC;AAKD,8CAEC;AAKD,sCAQC;AA9DD;;;GAGG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,MAAM,MAAM,GAAqB,EAAE,CAAC;IACpC,IAAI,aAAa,GAAkB,IAAI,CAAC;IACxC,IAAI,aAAa,GAAkB,IAAI,CAAC;IAExC,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AAC;AAChB,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,IAAY,EAAE,MAAwB;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC;AACtE,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,IAAY,EAAE,MAAc;IACxD,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACnD,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;YACrB,IAAI,EAAE,CAAC;QACT,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SecurityReport, SecurityScanConfig } from './types';
|
|
2
|
+
export { buildReport, SecurityRuleRegistry } from './registry';
|
|
3
|
+
export { agentHijackingRule, dangerousExecutionRule, dataExfiltrationRule, defaultSecurityRules, promptInjectionRule, supplyChainRule, unicodeAttacksRule, urlThreatsRule, xssHtmlInjectionRule, } from './rules';
|
|
4
|
+
export * from './types';
|
|
5
|
+
/**
|
|
6
|
+
* Scan a dossier's markdown body for security threats.
|
|
7
|
+
*
|
|
8
|
+
* Accepts raw dossier content (frontmatter + body) as a string.
|
|
9
|
+
*/
|
|
10
|
+
export declare function scanDossier(content: string, config?: SecurityScanConfig): SecurityReport;
|
|
11
|
+
/**
|
|
12
|
+
* Scan a dossier file at the given path for security threats.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scanDossierFile(filePath: string, config?: SecurityScanConfig): SecurityReport;
|
|
15
|
+
/**
|
|
16
|
+
* Scan raw markdown text (without dossier frontmatter) for security threats.
|
|
17
|
+
*
|
|
18
|
+
* Useful for scanning arbitrary markdown files that are not dossiers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function scanMarkdown(markdown: string, config?: SecurityScanConfig): SecurityReport;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/security-scanner/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAuB,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvF,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,GACrB,MAAM,SAAS,CAAC;AACjB,cAAc,SAAS,CAAC;AAUxB;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAaxF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAa7F;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,GAAG,cAAc,CAY1F"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.xssHtmlInjectionRule = exports.urlThreatsRule = exports.unicodeAttacksRule = exports.supplyChainRule = exports.promptInjectionRule = exports.defaultSecurityRules = exports.dataExfiltrationRule = exports.dangerousExecutionRule = exports.agentHijackingRule = exports.SecurityRuleRegistry = exports.buildReport = void 0;
|
|
18
|
+
exports.scanDossier = scanDossier;
|
|
19
|
+
exports.scanDossierFile = scanDossierFile;
|
|
20
|
+
exports.scanMarkdown = scanMarkdown;
|
|
21
|
+
const parser_1 = require("../parser");
|
|
22
|
+
const registry_1 = require("./registry");
|
|
23
|
+
const rules_1 = require("./rules");
|
|
24
|
+
var registry_2 = require("./registry");
|
|
25
|
+
Object.defineProperty(exports, "buildReport", { enumerable: true, get: function () { return registry_2.buildReport; } });
|
|
26
|
+
Object.defineProperty(exports, "SecurityRuleRegistry", { enumerable: true, get: function () { return registry_2.SecurityRuleRegistry; } });
|
|
27
|
+
var rules_2 = require("./rules");
|
|
28
|
+
Object.defineProperty(exports, "agentHijackingRule", { enumerable: true, get: function () { return rules_2.agentHijackingRule; } });
|
|
29
|
+
Object.defineProperty(exports, "dangerousExecutionRule", { enumerable: true, get: function () { return rules_2.dangerousExecutionRule; } });
|
|
30
|
+
Object.defineProperty(exports, "dataExfiltrationRule", { enumerable: true, get: function () { return rules_2.dataExfiltrationRule; } });
|
|
31
|
+
Object.defineProperty(exports, "defaultSecurityRules", { enumerable: true, get: function () { return rules_2.defaultSecurityRules; } });
|
|
32
|
+
Object.defineProperty(exports, "promptInjectionRule", { enumerable: true, get: function () { return rules_2.promptInjectionRule; } });
|
|
33
|
+
Object.defineProperty(exports, "supplyChainRule", { enumerable: true, get: function () { return rules_2.supplyChainRule; } });
|
|
34
|
+
Object.defineProperty(exports, "unicodeAttacksRule", { enumerable: true, get: function () { return rules_2.unicodeAttacksRule; } });
|
|
35
|
+
Object.defineProperty(exports, "urlThreatsRule", { enumerable: true, get: function () { return rules_2.urlThreatsRule; } });
|
|
36
|
+
Object.defineProperty(exports, "xssHtmlInjectionRule", { enumerable: true, get: function () { return rules_2.xssHtmlInjectionRule; } });
|
|
37
|
+
__exportStar(require("./types"), exports);
|
|
38
|
+
const defaultConfig = { rules: {} };
|
|
39
|
+
function createRegistry() {
|
|
40
|
+
const registry = new registry_1.SecurityRuleRegistry();
|
|
41
|
+
registry.registerAll(rules_1.defaultSecurityRules);
|
|
42
|
+
return registry;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Scan a dossier's markdown body for security threats.
|
|
46
|
+
*
|
|
47
|
+
* Accepts raw dossier content (frontmatter + body) as a string.
|
|
48
|
+
*/
|
|
49
|
+
function scanDossier(content, config) {
|
|
50
|
+
const parsed = (0, parser_1.parseDossierContent)(content);
|
|
51
|
+
const resolvedConfig = config ?? defaultConfig;
|
|
52
|
+
const registry = createRegistry();
|
|
53
|
+
const context = {
|
|
54
|
+
frontmatter: parsed.frontmatter,
|
|
55
|
+
body: parsed.body,
|
|
56
|
+
raw: parsed.raw,
|
|
57
|
+
};
|
|
58
|
+
const findings = registry.run(context, resolvedConfig);
|
|
59
|
+
return (0, registry_1.buildReport)(findings);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Scan a dossier file at the given path for security threats.
|
|
63
|
+
*/
|
|
64
|
+
function scanDossierFile(filePath, config) {
|
|
65
|
+
const parsed = (0, parser_1.parseDossierFile)(filePath);
|
|
66
|
+
const resolvedConfig = config ?? defaultConfig;
|
|
67
|
+
const registry = createRegistry();
|
|
68
|
+
const context = {
|
|
69
|
+
frontmatter: parsed.frontmatter,
|
|
70
|
+
body: parsed.body,
|
|
71
|
+
raw: parsed.raw,
|
|
72
|
+
};
|
|
73
|
+
const findings = registry.run(context, resolvedConfig);
|
|
74
|
+
return (0, registry_1.buildReport)(findings, filePath);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Scan raw markdown text (without dossier frontmatter) for security threats.
|
|
78
|
+
*
|
|
79
|
+
* Useful for scanning arbitrary markdown files that are not dossiers.
|
|
80
|
+
*/
|
|
81
|
+
function scanMarkdown(markdown, config) {
|
|
82
|
+
const resolvedConfig = config ?? defaultConfig;
|
|
83
|
+
const registry = createRegistry();
|
|
84
|
+
const context = {
|
|
85
|
+
frontmatter: {},
|
|
86
|
+
body: markdown,
|
|
87
|
+
raw: markdown,
|
|
88
|
+
};
|
|
89
|
+
const findings = registry.run(context, resolvedConfig);
|
|
90
|
+
return (0, registry_1.buildReport)(findings);
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/security-scanner/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAgCA,kCAaC;AAKD,0CAaC;AAOD,oCAYC;AAlFD,sCAAkE;AAClE,yCAA+D;AAC/D,mCAA+C;AAG/C,uCAA+D;AAAtD,uGAAA,WAAW,OAAA;AAAE,gHAAA,oBAAoB,OAAA;AAC1C,iCAUiB;AATf,2GAAA,kBAAkB,OAAA;AAClB,+GAAA,sBAAsB,OAAA;AACtB,6GAAA,oBAAoB,OAAA;AACpB,6GAAA,oBAAoB,OAAA;AACpB,4GAAA,mBAAmB,OAAA;AACnB,wGAAA,eAAe,OAAA;AACf,2GAAA,kBAAkB,OAAA;AAClB,uGAAA,cAAc,OAAA;AACd,6GAAA,oBAAoB,OAAA;AAEtB,0CAAwB;AAExB,MAAM,aAAa,GAAuB,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;A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AE,MAA2B;IACxE,MAAM,cAAc,GAAG,MAAM,IAAI,aAAa,CAAC;IAC/C,MAAM,QAAQ,GAAG,cAAc,EAAE,CAAC;IAElC,MAAM,OAAO,GAAwB;QACnC,WAAW,EAAE,EAAwC;QACrD,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,QAAQ;KACd,CAAC;IAEF,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IACvD,OAAO,IAAA,sBAAW,EAAC,QAAQ,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared regex matching utility for security rules.
|
|
3
|
+
*
|
|
4
|
+
* Avoids the `noAssignInExpressions` lint violation by using
|
|
5
|
+
* `matchAll` instead of a `while (match = exec())` loop.
|
|
6
|
+
*/
|
|
7
|
+
import { type CodeBlockRange } from './code-block-context';
|
|
8
|
+
import type { SecurityCategory, SecurityFinding, SecuritySeverity } from './types';
|
|
9
|
+
export interface PatternDefinition {
|
|
10
|
+
pattern: RegExp;
|
|
11
|
+
description: string;
|
|
12
|
+
}
|
|
13
|
+
export interface PatternWithSeverity extends PatternDefinition {
|
|
14
|
+
severity: SecuritySeverity;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Run a global regex against text and collect all matches as SecurityFindings.
|
|
18
|
+
* Uses `String.matchAll` to avoid assignment-in-expression.
|
|
19
|
+
*/
|
|
20
|
+
export declare function matchPattern(text: string, pattern: RegExp, codeBlockRanges: CodeBlockRange[], ruleId: string, category: SecurityCategory, description: string, defaultSeverity: SecuritySeverity, codeBlockSeverity?: SecuritySeverity): SecurityFinding[];
|
|
21
|
+
//# sourceMappingURL=match-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match-utils.d.ts","sourceRoot":"","sources":["../../src/security-scanner/match-utils.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAoC,MAAM,sBAAsB,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEnF,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;IAC5D,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,eAAe,EAAE,cAAc,EAAE,EACjC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,gBAAgB,EAC1B,WAAW,EAAE,MAAM,EACnB,eAAe,EAAE,gBAAgB,EACjC,iBAAiB,GAAE,gBAAyB,GAC3C,eAAe,EAAE,CAsBnB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Shared regex matching utility for security rules.
|
|
4
|
+
*
|
|
5
|
+
* Avoids the `noAssignInExpressions` lint violation by using
|
|
6
|
+
* `matchAll` instead of a `while (match = exec())` loop.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.matchPattern = matchPattern;
|
|
10
|
+
const code_block_context_1 = require("./code-block-context");
|
|
11
|
+
/**
|
|
12
|
+
* Run a global regex against text and collect all matches as SecurityFindings.
|
|
13
|
+
* Uses `String.matchAll` to avoid assignment-in-expression.
|
|
14
|
+
*/
|
|
15
|
+
function matchPattern(text, pattern, codeBlockRanges, ruleId, category, description, defaultSeverity, codeBlockSeverity = 'info') {
|
|
16
|
+
const findings = [];
|
|
17
|
+
// Ensure the regex has the global flag for matchAll
|
|
18
|
+
const globalPattern = pattern.global ? pattern : new RegExp(pattern.source, `${pattern.flags}g`);
|
|
19
|
+
for (const match of text.matchAll(globalPattern)) {
|
|
20
|
+
const line = (0, code_block_context_1.getLineNumber)(text, match.index ?? 0);
|
|
21
|
+
const inCodeBlock = (0, code_block_context_1.isLineInCodeBlock)(line, codeBlockRanges);
|
|
22
|
+
findings.push({
|
|
23
|
+
ruleId,
|
|
24
|
+
category,
|
|
25
|
+
severity: inCodeBlock ? codeBlockSeverity : defaultSeverity,
|
|
26
|
+
message: `${formatCategory(category)}: ${description}`,
|
|
27
|
+
evidence: match[0].slice(0, 200),
|
|
28
|
+
line,
|
|
29
|
+
inCodeBlock,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return findings;
|
|
33
|
+
}
|
|
34
|
+
function formatCategory(category) {
|
|
35
|
+
return category
|
|
36
|
+
.split('-')
|
|
37
|
+
.map((w) => w.charAt(0).toUpperCase() + w.slice(1))
|
|
38
|
+
.join(' ');
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=match-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"match-utils.js","sourceRoot":"","sources":["../../src/security-scanner/match-utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAkBH,oCA+BC;AA/CD,6DAA6F;AAY7F;;;GAGG;AACH,SAAgB,YAAY,CAC1B,IAAY,EACZ,OAAe,EACf,eAAiC,EACjC,MAAc,EACd,QAA0B,EAC1B,WAAmB,EACnB,eAAiC,EACjC,oBAAsC,MAAM;IAE5C,MAAM,QAAQ,GAAsB,EAAE,CAAC;IAEvC,oDAAoD;IACpD,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,GAAG,CAAC,CAAC;IAEjG,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,GAAG,IAAA,kCAAa,EAAC,IAAI,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;QACnD,MAAM,WAAW,GAAG,IAAA,sCAAiB,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QAE7D,QAAQ,CAAC,IAAI,CAAC;YACZ,MAAM;YACN,QAAQ;YACR,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC,eAAe;YAC3D,OAAO,EAAE,GAAG,cAAc,CAAC,QAAQ,CAAC,KAAK,WAAW,EAAE;YACtD,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC;YAChC,IAAI;YACJ,WAAW;SACZ,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,SAAS,cAAc,CAAC,QAA0B;IAChD,OAAO,QAAQ;SACZ,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { SecurityFinding, SecurityReport, SecurityRule, SecurityRuleContext, SecurityScanConfig } from './types';
|
|
2
|
+
export declare class SecurityRuleRegistry {
|
|
3
|
+
private rules;
|
|
4
|
+
register(rule: SecurityRule): void;
|
|
5
|
+
registerAll(rules: SecurityRule[]): void;
|
|
6
|
+
getRules(): SecurityRule[];
|
|
7
|
+
getRule(id: string): SecurityRule | undefined;
|
|
8
|
+
run(context: SecurityRuleContext, config: SecurityScanConfig): SecurityFinding[];
|
|
9
|
+
}
|
|
10
|
+
export declare function buildReport(findings: SecurityFinding[], file?: string): SecurityReport;
|
|
11
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/security-scanner/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,cAAc,EACd,YAAY,EACZ,mBAAmB,EAEnB,kBAAkB,EAEnB,MAAM,SAAS,CAAC;AAUjB,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,KAAK,CAAwC;IAErD,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI;IAIlC,WAAW,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,IAAI;IAMxC,QAAQ,IAAI,YAAY,EAAE;IAI1B,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS;IAI7C,GAAG,CAAC,OAAO,EAAE,mBAAmB,EAAE,MAAM,EAAE,kBAAkB,GAAG,eAAe,EAAE;CAgCjF;AAED,wBAAgB,WAAW,CAAC,QAAQ,EAAE,eAAe,EAAE,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAwBtF"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SecurityRuleRegistry = void 0;
|
|
4
|
+
exports.buildReport = buildReport;
|
|
5
|
+
const SEVERITY_ORDER = {
|
|
6
|
+
critical: 4,
|
|
7
|
+
high: 3,
|
|
8
|
+
medium: 2,
|
|
9
|
+
low: 1,
|
|
10
|
+
info: 0,
|
|
11
|
+
};
|
|
12
|
+
class SecurityRuleRegistry {
|
|
13
|
+
rules = new Map();
|
|
14
|
+
register(rule) {
|
|
15
|
+
this.rules.set(rule.id, rule);
|
|
16
|
+
}
|
|
17
|
+
registerAll(rules) {
|
|
18
|
+
for (const rule of rules) {
|
|
19
|
+
this.register(rule);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
getRules() {
|
|
23
|
+
return Array.from(this.rules.values());
|
|
24
|
+
}
|
|
25
|
+
getRule(id) {
|
|
26
|
+
return this.rules.get(id);
|
|
27
|
+
}
|
|
28
|
+
run(context, config) {
|
|
29
|
+
const findings = [];
|
|
30
|
+
const minSeverityLevel = SEVERITY_ORDER[config.minSeverity ?? 'info'];
|
|
31
|
+
for (const rule of this.rules.values()) {
|
|
32
|
+
const override = config.rules[rule.id];
|
|
33
|
+
if (override === 'off') {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
const severity = override
|
|
37
|
+
? override
|
|
38
|
+
: rule.defaultSeverity;
|
|
39
|
+
if (SEVERITY_ORDER[severity] < minSeverityLevel) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const ruleFindings = rule.detect(context);
|
|
43
|
+
for (const f of ruleFindings) {
|
|
44
|
+
// Respect the code-block downgrade: if the rule already lowered the
|
|
45
|
+
// severity for an in-code-block finding, keep that lower severity
|
|
46
|
+
// rather than overriding it with the config/default level.
|
|
47
|
+
const effectiveSeverity = f.inCodeBlock ? f.severity : severity;
|
|
48
|
+
findings.push({ ...f, severity: effectiveSeverity });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return findings;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.SecurityRuleRegistry = SecurityRuleRegistry;
|
|
55
|
+
function buildReport(findings, file) {
|
|
56
|
+
const criticalCount = findings.filter((f) => f.severity === 'critical').length;
|
|
57
|
+
const highCount = findings.filter((f) => f.severity === 'high').length;
|
|
58
|
+
const mediumCount = findings.filter((f) => f.severity === 'medium').length;
|
|
59
|
+
const lowCount = findings.filter((f) => f.severity === 'low').length;
|
|
60
|
+
const infoCount = findings.filter((f) => f.severity === 'info').length;
|
|
61
|
+
let verdict = 'PASS';
|
|
62
|
+
if (criticalCount > 0 || highCount > 0) {
|
|
63
|
+
verdict = 'FAIL';
|
|
64
|
+
}
|
|
65
|
+
else if (mediumCount > 0) {
|
|
66
|
+
verdict = 'WARN';
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
file,
|
|
70
|
+
findings,
|
|
71
|
+
criticalCount,
|
|
72
|
+
highCount,
|
|
73
|
+
mediumCount,
|
|
74
|
+
lowCount,
|
|
75
|
+
infoCount,
|
|
76
|
+
verdict,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/security-scanner/registry.ts"],"names":[],"mappings":";;;AAyEA,kCAwBC;AAvFD,MAAM,cAAc,GAAqC;IACvD,QAAQ,EAAE,CAAC;IACX,IAAI,EAAE,CAAC;IACP,MAAM,EAAE,CAAC;IACT,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,CAAC;CACR,CAAC;AAEF,MAAa,oBAAoB;IACvB,KAAK,GAA8B,IAAI,GAAG,EAAE,CAAC;IAErD,QAAQ,CAAC,IAAkB;QACzB,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;IAED,WAAW,CAAC,KAAqB;QAC/B,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAED,QAAQ;QACN,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;IAED,GAAG,CAAC,OAA4B,EAAE,MAA0B;QAC1D,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,MAAM,gBAAgB,GAAG,cAAc,CAAC,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,CAAC;QAEtE,KAAK,MAAM,IAAI,IAAI,IAAI,C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,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;IAC3E,MAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC,MAAM,CAAC;IACrE,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,MAAM,CAAC;IAEvE,IAAI,OAAO,GAA6B,MAAM,CAAC;IAC/C,IAAI,aAAa,GAAG,CAAC,IAAI,SAAS,GAAG,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;SAAM,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IAED,OAAO;QACL,IAAI;QACJ,QAAQ;QACR,aAAa;QACb,SAAS;QACT,WAAW;QACX,QAAQ;QACR,SAAS;QACT,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-hijacking.d.ts","sourceRoot":"","sources":["../../../src/security-scanner/rules/agent-hijacking.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,UAAU,CAAC;AA2C9D,eAAO,MAAM,kBAAkB,EAAE,YA0BhC,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.agentHijackingRule = void 0;
|
|
4
|
+
const code_block_context_1 = require("../code-block-context");
|
|
5
|
+
const match_utils_1 = require("../match-utils");
|
|
6
|
+
/**
|
|
7
|
+
* Patterns that attempt to hijack agent behavior — overriding system instructions,
|
|
8
|
+
* granting autonomy, or suppressing safety checks.
|
|
9
|
+
*/
|
|
10
|
+
const AGENT_HIJACKING_PATTERNS = [
|
|
11
|
+
// Attempts to override system instructions
|
|
12
|
+
{
|
|
13
|
+
pattern: /(?:new|updated|revised|real)\s+system\s+(?:prompt|instructions?|message|directive)/gi,
|
|
14
|
+
description: 'Attempt to inject new system instructions',
|
|
15
|
+
},
|
|
16
|
+
// Granting unrestricted autonomy
|
|
17
|
+
{
|
|
18
|
+
pattern: /(?:you\s+(?:have|are\s+granted|now\s+have)\s+)?(?:full|unrestricted|unlimited|complete)\s+(?:access|autonomy|control|permissions?|authority)/gi,
|
|
19
|
+
description: 'Attempt to grant unrestricted autonomy/permissions',
|
|
20
|
+
},
|
|
21
|
+
// Suppressing safety checks
|
|
22
|
+
{
|
|
23
|
+
pattern: /(?:skip|bypass|disable|ignore|turn\s+off|suppress)\s+(?:safety|security|verification|validation|approval|confirmation|checks?|guards?|filters?)/gi,
|
|
24
|
+
description: 'Attempt to suppress safety/security checks',
|
|
25
|
+
},
|
|
26
|
+
// Role reassignment
|
|
27
|
+
{
|
|
28
|
+
pattern: /(?:act\s+as|pretend\s+(?:to\s+be|you(?:'re| are))|roleplay\s+as|switch\s+(?:to|into)\s+(?:a\s+)?(?:root|admin|superuser|developer|DAN|jailbr))/gi,
|
|
29
|
+
description: 'Role reassignment / jailbreak attempt',
|
|
30
|
+
},
|
|
31
|
+
// "Do anything now" (DAN) style jailbreaks
|
|
32
|
+
{
|
|
33
|
+
pattern: /\bDAN\s+(?:mode|prompt|jailbreak)\b|do\s+anything\s+now/gi,
|
|
34
|
+
description: 'DAN-style jailbreak pattern',
|
|
35
|
+
},
|
|
36
|
+
// Instruction to not follow rules
|
|
37
|
+
{
|
|
38
|
+
pattern: /(?:don'?t|do\s+not|never)\s+(?:follow|obey|adhere\s+to|comply\s+with)\s+(?:the\s+)?(?:rules?|guidelines?|policies?|restrictions?|constraints?)/gi,
|
|
39
|
+
description: 'Instruction to not follow rules/guidelines',
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
exports.agentHijackingRule = {
|
|
43
|
+
id: 'agent-hijacking',
|
|
44
|
+
category: 'agent-hijacking',
|
|
45
|
+
description: 'Detects attempts to hijack agent behavior — system instruction overrides and autonomy escalation',
|
|
46
|
+
defaultSeverity: 'critical',
|
|
47
|
+
detect(context) {
|
|
48
|
+
const findings = [];
|
|
49
|
+
const codeBlockRanges = (0, code_block_context_1.parseCodeBlockRanges)(context.body);
|
|
50
|
+
for (const { pattern, description } of AGENT_HIJACKING_PATTERNS) {
|
|
51
|
+
findings.push(...(0, match_utils_1.matchPattern)(context.body, pattern, codeBlockRanges, 'agent-hijacking', 'agent-hijacking', description, 'critical'));
|
|
52
|
+
}
|
|
53
|
+
return findings;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=agent-hijacking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-hijacking.js","sourceRoot":"","sources":["../../../src/security-scanner/rules/agent-hijacking.ts"],"names":[],"mappings":";;;AAAA,8DAA6D;AAC7D,gDAA8C;AAG9C;;;GAGG;AACH,MAAM,wBAAwB,GAA+C;IAC3E,2CAA2C;IAC3C;QACE,OAAO,EAAE,sFAAsF;QAC/F,WAAW,EAAE,2CAA2C;KACzD;IACD,iCAAiC;IACjC;QACE,OAAO,EACL,gJAAgJ;QAClJ,WAAW,EAAE,oDAAoD;KAClE;IACD,4BAA4B;IAC5B;QACE,OAAO,EACL,mJAAmJ;QACrJ,WAAW,EAAE,4CAA4C;KAC1D;IACD,oBAAoB;IACpB;QACE,OAAO,EACL,kJAAkJ;QACpJ,WAAW,EAAE,uCAAuC;KACrD;IACD,2CAA2C;IAC3C;QACE,OAAO,EAAE,2DAA2D;QACpE,WAAW,EAAE,6BAA6B;KAC3C;IACD,kCAAkC;IAClC;QACE,OAAO,EACL,kJAAkJ;QACpJ,WAAW,EAAE,4CAA4C;KAC1D;CACF,CAAC;AAEW,QAAA,kBAAkB,GAAiB;IAC9C,EAAE,EAAE,iBAAiB;IACrB,QAAQ,EAAE,iBAAiB;IAC3B,WAAW,EACT,kGAAkG;IACpG,eAAe,EAAE,UAAU;IAC3B,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,MAAM,eAAe,GAAG,IAAA,yCAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3D,KAAK,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,wBAAwB,EAAE,CAAC;YAChE,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,0BAAY,EACb,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,WAAW,EACX,UAAU,CACX,CACF,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dangerous-execution.d.ts","sourceRoot":"","sources":["../../../src/security-scanner/rules/dangerous-execution.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,UAAU,CAAC;AAuE9D,eAAO,MAAM,sBAAsB,EAAE,YA0BpC,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dangerousExecutionRule = void 0;
|
|
4
|
+
const code_block_context_1 = require("../code-block-context");
|
|
5
|
+
const match_utils_1 = require("../match-utils");
|
|
6
|
+
/**
|
|
7
|
+
* Patterns for dangerous shell commands and code execution.
|
|
8
|
+
* These detect actual commands that could be destructive or facilitate code injection.
|
|
9
|
+
*/
|
|
10
|
+
const DANGEROUS_EXECUTION_PATTERNS = [
|
|
11
|
+
// Recursive force removal
|
|
12
|
+
{
|
|
13
|
+
pattern: /\brm\s+-[a-zA-Z]*r[a-zA-Z]*f[a-zA-Z]*\b|\brm\s+-[a-zA-Z]*f[a-zA-Z]*r[a-zA-Z]*\b/g,
|
|
14
|
+
description: 'Recursive force delete (rm -rf)',
|
|
15
|
+
},
|
|
16
|
+
// Pipe to shell — curl/wget piped to bash/sh
|
|
17
|
+
{
|
|
18
|
+
pattern: /(?:curl|wget)\s+[^\n|]*\|\s*(?:ba)?sh\b|(?:curl|wget)\s+[^\n|]*\|\s*(?:sudo\s+)?(?:ba)?sh/g,
|
|
19
|
+
description: 'Remote script execution (curl/wget piped to shell)',
|
|
20
|
+
},
|
|
21
|
+
// eval with variable/dynamic content
|
|
22
|
+
{
|
|
23
|
+
pattern: /\beval\s*\(\s*["`$]|\beval\s+["'`$]/g,
|
|
24
|
+
description: 'Dynamic eval execution',
|
|
25
|
+
},
|
|
26
|
+
// chmod 777 (world-writable)
|
|
27
|
+
{
|
|
28
|
+
pattern: /\bchmod\s+777\b/g,
|
|
29
|
+
description: 'Setting world-writable permissions (chmod 777)',
|
|
30
|
+
},
|
|
31
|
+
// dd writing to block devices
|
|
32
|
+
{
|
|
33
|
+
pattern: /\bdd\s+.*\bof\s*=\s*\/dev\//g,
|
|
34
|
+
description: 'Direct block device write (dd of=/dev/...)',
|
|
35
|
+
},
|
|
36
|
+
// mkfs (format filesystem)
|
|
37
|
+
{
|
|
38
|
+
pattern: /\bmkfs\b/g,
|
|
39
|
+
description: 'Filesystem format command (mkfs)',
|
|
40
|
+
},
|
|
41
|
+
// Fork bomb patterns
|
|
42
|
+
{
|
|
43
|
+
pattern: /:\(\)\s*\{\s*:\|:\s*&\s*\}\s*;?\s*:/g,
|
|
44
|
+
description: 'Fork bomb',
|
|
45
|
+
},
|
|
46
|
+
// Python/Node one-liner execution
|
|
47
|
+
{
|
|
48
|
+
pattern: /python[23]?\s+-c\s+['"].*(?:exec|eval|import\s+os|subprocess|__import__)/g,
|
|
49
|
+
description: 'Python one-liner with dangerous imports/execution',
|
|
50
|
+
},
|
|
51
|
+
// Encoded/obfuscated command execution
|
|
52
|
+
{
|
|
53
|
+
pattern: /\bbase64\s+-d\b.*\|\s*(?:ba)?sh/g,
|
|
54
|
+
description: 'Base64-decoded payload piped to shell',
|
|
55
|
+
},
|
|
56
|
+
// Overwriting critical system files
|
|
57
|
+
{
|
|
58
|
+
pattern: />\s*\/etc\/(?:passwd|shadow|sudoers|hosts|crontab)/g,
|
|
59
|
+
description: 'Overwriting critical system file',
|
|
60
|
+
},
|
|
61
|
+
// Reverse shell patterns
|
|
62
|
+
{
|
|
63
|
+
pattern: /\bbash\s+-i\s+>&?\s*\/dev\/tcp\/|\bnc\s+.*-e\s+\/bin\/(?:ba)?sh|\bsocat\b.*\bexec\b.*\/bin\/(?:ba)?sh/g,
|
|
64
|
+
description: 'Reverse shell pattern',
|
|
65
|
+
},
|
|
66
|
+
// crontab injection
|
|
67
|
+
{
|
|
68
|
+
pattern: /(?:echo|printf)\s+.*\|\s*crontab/g,
|
|
69
|
+
description: 'Crontab injection via pipe',
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
exports.dangerousExecutionRule = {
|
|
73
|
+
id: 'dangerous-execution',
|
|
74
|
+
category: 'dangerous-execution',
|
|
75
|
+
description: 'Detects dangerous shell commands — rm -rf, curl|sh, eval, reverse shells, etc.',
|
|
76
|
+
defaultSeverity: 'high',
|
|
77
|
+
detect(context) {
|
|
78
|
+
const findings = [];
|
|
79
|
+
const codeBlockRanges = (0, code_block_context_1.parseCodeBlockRanges)(context.body);
|
|
80
|
+
for (const { pattern, description } of DANGEROUS_EXECUTION_PATTERNS) {
|
|
81
|
+
findings.push(...(0, match_utils_1.matchPattern)(context.body, pattern, codeBlockRanges, 'dangerous-execution', 'dangerous-execution', description, 'high', 'low'));
|
|
82
|
+
}
|
|
83
|
+
return findings;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=dangerous-execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dangerous-execution.js","sourceRoot":"","sources":["../../../src/security-scanner/rules/dangerous-execution.ts"],"names":[],"mappings":";;;AA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AAe,GAAG,IAAA,yCAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3D,KAAK,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,4BAA4B,EAAE,CAAC;YACpE,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,0BAAY,EACb,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,eAAe,EACf,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACX,MAAM,EACN,KAAK,CACN,CACF,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-exfiltration.d.ts","sourceRoot":"","sources":["../../../src/security-scanner/rules/data-exfiltration.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAmB,YAAY,EAAE,MAAM,UAAU,CAAC;AAgD9D,eAAO,MAAM,oBAAoB,EAAE,YA0BlC,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataExfiltrationRule = void 0;
|
|
4
|
+
const code_block_context_1 = require("../code-block-context");
|
|
5
|
+
const match_utils_1 = require("../match-utils");
|
|
6
|
+
/**
|
|
7
|
+
* Patterns that indicate data exfiltration — sending data to external URLs
|
|
8
|
+
* via image tags, tracking pixels, DNS exfil, or webhook-based exfil.
|
|
9
|
+
*/
|
|
10
|
+
const DATA_EXFILTRATION_PATTERNS = [
|
|
11
|
+
// Markdown image with dynamic/parameterized URL (data in query string)
|
|
12
|
+
{
|
|
13
|
+
pattern: /!\[[^\]]*\]\(https?:\/\/[^)]*(?:\$\{|`[^`]*`|\{\{)[^)]*\)/g,
|
|
14
|
+
description: 'Markdown image with dynamic/templated URL (potential data exfiltration)',
|
|
15
|
+
},
|
|
16
|
+
// HTML image with suspicious query parameters suggesting data exfil
|
|
17
|
+
{
|
|
18
|
+
pattern: /<img[^>]+src\s*=\s*["']https?:\/\/[^"']*(?:data=|exfil=|payload=|token=|secret=|key=|password=|env=)[^"']*["']/gi,
|
|
19
|
+
description: 'HTML image tag with data exfiltration query parameters',
|
|
20
|
+
},
|
|
21
|
+
// 1x1 tracking pixel (common exfil technique)
|
|
22
|
+
{
|
|
23
|
+
pattern: /<img[^>]+(?:width\s*=\s*["']1["'][^>]*height\s*=\s*["']1["']|height\s*=\s*["']1["'][^>]*width\s*=\s*["']1["'])/gi,
|
|
24
|
+
description: 'Tracking pixel (1x1 image)',
|
|
25
|
+
},
|
|
26
|
+
// curl/wget/fetch sending data to external URLs
|
|
27
|
+
{
|
|
28
|
+
pattern: /(?:curl|wget)\s+.*(?:-d\s|--data\s|--post-data\s|--upload-file\s|-F\s).*https?:\/\//g,
|
|
29
|
+
description: 'Sending data to external URL via curl/wget',
|
|
30
|
+
},
|
|
31
|
+
// DNS exfiltration pattern
|
|
32
|
+
{
|
|
33
|
+
pattern: /(?:dig|nslookup|host)\s+[^\s]*\$[{(]|\$\([^)]*\)\.[\w.-]+\.\w{2,}/g,
|
|
34
|
+
description: 'Potential DNS exfiltration (dynamic subdomain query)',
|
|
35
|
+
},
|
|
36
|
+
// Webhook URLs (common exfil destinations)
|
|
37
|
+
{
|
|
38
|
+
pattern: /https?:\/\/(?:(?:hooks\.slack\.com|discord(?:app)?\.com\/api\/webhooks|webhook\.site|requestbin\.com|pipedream\.net|hookbin\.com|burpcollaborator\.net|interact\.sh|canarytokens\.com)[^\s"')<]*)/gi,
|
|
39
|
+
description: 'Webhook or request-capture URL (common exfiltration destination)',
|
|
40
|
+
},
|
|
41
|
+
// Sending environment variables or secrets to external URLs
|
|
42
|
+
{
|
|
43
|
+
pattern: /(?:curl|wget|fetch|http\.post|requests\.post)\s*[(\s].*(?:\$\{?\w*(?:SECRET|TOKEN|KEY|PASSWORD|API_KEY|AWS_)\w*\}?|process\.env\.\w+|os\.environ)/gi,
|
|
44
|
+
description: 'Sending environment variables/secrets to external endpoint',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
exports.dataExfiltrationRule = {
|
|
48
|
+
id: 'data-exfiltration',
|
|
49
|
+
category: 'data-exfiltration',
|
|
50
|
+
description: 'Detects data exfiltration patterns — image-based exfil, tracking pixels, webhook exfil',
|
|
51
|
+
defaultSeverity: 'high',
|
|
52
|
+
detect(context) {
|
|
53
|
+
const findings = [];
|
|
54
|
+
const codeBlockRanges = (0, code_block_context_1.parseCodeBlockRanges)(context.body);
|
|
55
|
+
for (const { pattern, description } of DATA_EXFILTRATION_PATTERNS) {
|
|
56
|
+
findings.push(...(0, match_utils_1.matchPattern)(context.body, pattern, codeBlockRanges, 'data-exfiltration', 'data-exfiltration', description, 'high'));
|
|
57
|
+
}
|
|
58
|
+
return findings;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=data-exfiltration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"data-exfiltration.js","sourceRoot":"","sources":["../../../src/security-scanner/rules/data-exfiltration.ts"],"names":[],"mappings":";;;AAAA,8DAA6D;AAC7D,gDAA8C;AAG9C;;;GAGG;AACH,MAAM,0BAA0B,GAA+C;IAC7E,uEAAuE;IACvE;QACE,OAAO,EAAE,4DAA4D;QACrE,WAAW,EAAE,yEAAyE;KACvF;IACD,oEAAoE;IACpE;QACE,OAAO,EACL,kHAAkH;QACpH,WAAW,EAAE,wDAAwD;KACtE;IACD,8CAA8C;IAC9C;QACE,OAAO,EACL,kHAAkH;QACpH,WAAW,EAAE,4BAA4B;KAC1C;IACD,gDAAgD;IAChD;QACE,OAAO,EAAE,sFAAsF;QAC/F,WAAW,EAAE,4CAA4C;KAC1D;IACD,2BAA2B;IAC3B;QACE,OAAO,EAAE,oEAAoE;QAC7E,WAAW,EAAE,sDAAsD;KACpE;IACD,2CAA2C;IAC3C;QACE,OAAO,EACL,qMAAqM;QACvM,WAAW,EAAE,kEAAkE;KAChF;IACD,4DAA4D;IAC5D;QACE,OAAO,EACL,qJAAqJ;QACvJ,WAAW,EAAE,4DAA4D;KAC1E;CACF,CAAC;AAEW,QAAA,oBAAoB,GAAiB;IAChD,EAAE,EAAE,mBAAmB;IACvB,QAAQ,EAAE,mBAAmB;IAC7B,WAAW,EACT,wFAAwF;IAC1F,eAAe,EAAE,MAAM;IACvB,MAAM,CAAC,OAAO;QACZ,MAAM,QAAQ,GAAsB,EAAE,CAAC;QACvC,MAAM,eAAe,GAAG,IAAA,yCAAoB,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAE3D,KAAK,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,0BAA0B,EAAE,CAAC;YAClE,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,0BAAY,EACb,OAAO,CAAC,IAAI,EACZ,OAAO,EACP,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,MAAM,CACP,CACF,CAAC;QACJ,CAAC;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SecurityRule } from '../types';
|
|
2
|
+
import { agentHijackingRule } from './agent-hijacking';
|
|
3
|
+
import { dangerousExecutionRule } from './dangerous-execution';
|
|
4
|
+
import { dataExfiltrationRule } from './data-exfiltration';
|
|
5
|
+
import { promptInjectionRule } from './prompt-injection';
|
|
6
|
+
import { supplyChainRule } from './supply-chain';
|
|
7
|
+
import { unicodeAttacksRule } from './unicode-attacks';
|
|
8
|
+
import { urlThreatsRule } from './url-threats';
|
|
9
|
+
import { xssHtmlInjectionRule } from './xss-html-injection';
|
|
10
|
+
export { agentHijackingRule, dangerousExecutionRule, dataExfiltrationRule, promptInjectionRule, supplyChainRule, unicodeAttacksRule, urlThreatsRule, xssHtmlInjectionRule, };
|
|
11
|
+
export declare const defaultSecurityRules: SecurityRule[];
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/security-scanner/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,oBAAoB,GACrB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAAY,EAS9C,CAAC"}
|