@guardbee/mcp-reverse-shield 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +117 -2
- package/TR.md +114 -0
- package/ZH.md +61 -0
- package/dist/__tests__/android.test.d.ts +2 -0
- package/dist/__tests__/android.test.d.ts.map +1 -0
- package/dist/__tests__/android.test.js +114 -0
- package/dist/__tests__/android.test.js.map +1 -0
- package/dist/__tests__/electron.test.d.ts +2 -0
- package/dist/__tests__/electron.test.d.ts.map +1 -0
- package/dist/__tests__/electron.test.js +128 -0
- package/dist/__tests__/electron.test.js.map +1 -0
- package/dist/__tests__/live.test.d.ts +2 -0
- package/dist/__tests__/live.test.d.ts.map +1 -0
- package/dist/__tests__/live.test.js +67 -0
- package/dist/__tests__/live.test.js.map +1 -0
- package/dist/__tests__/native.test.d.ts +2 -0
- package/dist/__tests__/native.test.d.ts.map +1 -0
- package/dist/__tests__/native.test.js +111 -0
- package/dist/__tests__/native.test.js.map +1 -0
- package/dist/__tests__/scanner.test.d.ts +2 -0
- package/dist/__tests__/scanner.test.d.ts.map +1 -0
- package/dist/__tests__/scanner.test.js +127 -0
- package/dist/__tests__/scanner.test.js.map +1 -0
- package/dist/__tests__/testFixtures.d.ts +61 -0
- package/dist/__tests__/testFixtures.d.ts.map +1 -0
- package/dist/__tests__/testFixtures.js +416 -0
- package/dist/__tests__/testFixtures.js.map +1 -0
- package/dist/__tests__/web.test.d.ts +2 -0
- package/dist/__tests__/web.test.d.ts.map +1 -0
- package/dist/__tests__/web.test.js +156 -0
- package/dist/__tests__/web.test.js.map +1 -0
- package/dist/apk.d.ts +9 -0
- package/dist/apk.d.ts.map +1 -0
- package/dist/apk.js +132 -0
- package/dist/apk.js.map +1 -0
- package/dist/asar.d.ts +10 -0
- package/dist/asar.d.ts.map +1 -0
- package/dist/asar.js +73 -0
- package/dist/asar.js.map +1 -0
- package/dist/axml.d.ts +20 -0
- package/dist/axml.d.ts.map +1 -0
- package/dist/axml.js +104 -0
- package/dist/axml.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +172 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +8 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +102 -0
- package/dist/config.js.map +1 -0
- package/dist/dex.d.ts +16 -0
- package/dist/dex.d.ts.map +1 -0
- package/dist/dex.js +63 -0
- package/dist/dex.js.map +1 -0
- package/dist/electron.d.ts +26 -0
- package/dist/electron.d.ts.map +1 -0
- package/dist/electron.js +146 -0
- package/dist/electron.js.map +1 -0
- package/dist/finding.d.ts +30 -0
- package/dist/finding.d.ts.map +1 -0
- package/dist/finding.js +38 -0
- package/dist/finding.js.map +1 -0
- package/dist/fsutil.d.ts +20 -0
- package/dist/fsutil.d.ts.map +1 -0
- package/dist/fsutil.js +80 -0
- package/dist/fsutil.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/live.d.ts +14 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/live.js +144 -0
- package/dist/live.js.map +1 -0
- package/dist/native.d.ts +18 -0
- package/dist/native.d.ts.map +1 -0
- package/dist/native.js +411 -0
- package/dist/native.js.map +1 -0
- package/dist/rules.d.ts +22 -0
- package/dist/rules.d.ts.map +1 -0
- package/dist/rules.js +354 -0
- package/dist/rules.js.map +1 -0
- package/dist/sarif.d.ts +3 -0
- package/dist/sarif.d.ts.map +1 -0
- package/dist/sarif.js +60 -0
- package/dist/sarif.js.map +1 -0
- package/dist/scanner.d.ts +27 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +169 -0
- package/dist/scanner.js.map +1 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +88 -0
- package/dist/server.js.map +1 -0
- package/dist/web.d.ts +56 -0
- package/dist/web.d.ts.map +1 -0
- package/dist/web.js +301 -0
- package/dist/web.js.map +1 -0
- package/dist/zip.d.ts +21 -0
- package/dist/zip.d.ts.map +1 -0
- package/dist/zip.js +112 -0
- package/dist/zip.js.map +1 -0
- package/package.json +52 -3
package/dist/rules.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Severity = "critical" | "high" | "medium" | "low";
|
|
2
|
+
export type RuleCategory = "source-exposure" | "obfuscation" | "debug-surface" | "tamper-resistance" | "binary-hardening" | "secrets-in-artifact";
|
|
3
|
+
export type TargetKind = "web" | "electron" | "android" | "native" | "dotnet";
|
|
4
|
+
export interface Rule {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
target: TargetKind;
|
|
8
|
+
category: RuleCategory;
|
|
9
|
+
severity: Severity;
|
|
10
|
+
/** What an analyst (or an agent driving a reverse-engineering MCP) gets out of this. */
|
|
11
|
+
exposes: string;
|
|
12
|
+
recommendation: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Every check this package runs. A finding carries one of these ids; the
|
|
16
|
+
* severity here is the default and a few checks raise or lower it from what
|
|
17
|
+
* they actually find (a source map that embeds the original sources is worse
|
|
18
|
+
* than one that only maps positions).
|
|
19
|
+
*/
|
|
20
|
+
export declare const RULES: Rule[];
|
|
21
|
+
export declare function getRule(id: string): Rule;
|
|
22
|
+
//# sourceMappingURL=rules.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAE9D,MAAM,MAAM,YAAY,GACpB,iBAAiB,GACjB,aAAa,GACb,eAAe,GACf,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9E,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,wFAAwF;IACxF,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,KAAK,EAAE,IAAI,EAuVvB,CAAC;AAIF,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAIxC"}
|
package/dist/rules.js
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every check this package runs. A finding carries one of these ids; the
|
|
3
|
+
* severity here is the default and a few checks raise or lower it from what
|
|
4
|
+
* they actually find (a source map that embeds the original sources is worse
|
|
5
|
+
* than one that only maps positions).
|
|
6
|
+
*/
|
|
7
|
+
export const RULES = [
|
|
8
|
+
// ── Web / JavaScript bundles ───────────────────────────────────────────────
|
|
9
|
+
{
|
|
10
|
+
id: "sourcemap_embeds_source",
|
|
11
|
+
name: "Source map ships the original source code",
|
|
12
|
+
target: "web",
|
|
13
|
+
category: "source-exposure",
|
|
14
|
+
severity: "critical",
|
|
15
|
+
exposes: "The complete pre-build source (file names, comments, un-minified code) via the map's sourcesContent.",
|
|
16
|
+
recommendation: "Do not deploy .map files. Generate them as 'hidden' source maps (webpack devtool: 'hidden-source-map', Vite build.sourcemap: 'hidden') and upload them only to your error tracker, or strip sourcesContent.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "sourcemap_shipped",
|
|
20
|
+
name: "Source map shipped with the build",
|
|
21
|
+
target: "web",
|
|
22
|
+
category: "source-exposure",
|
|
23
|
+
severity: "high",
|
|
24
|
+
exposes: "Original file paths, symbol names and line structure, which turn minified code back into readable modules.",
|
|
25
|
+
recommendation: "Remove .map files from the deployed output, or serve them only to authenticated error-tracking infrastructure.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "sourcemap_inline",
|
|
29
|
+
name: "Inline source map embedded in the bundle",
|
|
30
|
+
target: "web",
|
|
31
|
+
category: "source-exposure",
|
|
32
|
+
severity: "high",
|
|
33
|
+
exposes: "A base64 source map inside the JavaScript itself, so every visitor downloads it.",
|
|
34
|
+
recommendation: "Switch the production build away from inline source maps (webpack devtool 'inline-*', Vite build.sourcemap: 'inline').",
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "sourcemap_reference",
|
|
38
|
+
name: "Bundle points at a source map URL",
|
|
39
|
+
target: "web",
|
|
40
|
+
category: "source-exposure",
|
|
41
|
+
severity: "low",
|
|
42
|
+
exposes: "Where the map lives. If that URL is ever reachable, the original sources are one request away.",
|
|
43
|
+
recommendation: "Build with hidden source maps so the //# sourceMappingURL comment is not emitted.",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "sourcemap_publicly_reachable",
|
|
47
|
+
name: "Source map is publicly downloadable",
|
|
48
|
+
target: "web",
|
|
49
|
+
category: "source-exposure",
|
|
50
|
+
severity: "high",
|
|
51
|
+
exposes: "The live site serves the map for its own bundle to anyone who asks.",
|
|
52
|
+
recommendation: "Block *.map at the CDN/web server or stop uploading them with the static assets.",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "eval_devtool_bundle",
|
|
56
|
+
name: "Development-style eval bundle",
|
|
57
|
+
target: "web",
|
|
58
|
+
category: "source-exposure",
|
|
59
|
+
severity: "high",
|
|
60
|
+
exposes: "Each module wrapped in eval() with its original path (//# sourceURL=webpack://...), effectively a source tree.",
|
|
61
|
+
recommendation: "Build in production mode; eval-based devtool settings are for local development only.",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "unminified_bundle",
|
|
65
|
+
name: "Bundle is not minified",
|
|
66
|
+
target: "web",
|
|
67
|
+
category: "obfuscation",
|
|
68
|
+
severity: "medium",
|
|
69
|
+
exposes: "Readable identifiers, comments and control flow without any deobfuscation step.",
|
|
70
|
+
recommendation: "Enable minification (Terser/esbuild/SWC) with identifier mangling for production builds. Consider javascript-obfuscator for code that encodes business logic you need to protect.",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "dev_build_framework",
|
|
74
|
+
name: "Framework development build in production",
|
|
75
|
+
target: "web",
|
|
76
|
+
category: "debug-surface",
|
|
77
|
+
severity: "medium",
|
|
78
|
+
exposes: "Component names, prop types and dev-only warnings that map the UI structure and state.",
|
|
79
|
+
recommendation: "Set NODE_ENV=production (or the framework's production flag) for the build so the development runtime is tree-shaken out.",
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "bundle_secret",
|
|
83
|
+
name: "Credential embedded in shipped code",
|
|
84
|
+
target: "web",
|
|
85
|
+
category: "secrets-in-artifact",
|
|
86
|
+
severity: "high",
|
|
87
|
+
exposes: "A working credential that anyone who unpacks the artifact can lift, with no reverse engineering skill needed.",
|
|
88
|
+
recommendation: "Move the secret server-side and rotate it now; anything in a client bundle, app package or binary must be considered public.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "internal_endpoint",
|
|
92
|
+
name: "Internal or non-production endpoint in shipped code",
|
|
93
|
+
target: "web",
|
|
94
|
+
category: "debug-surface",
|
|
95
|
+
severity: "low",
|
|
96
|
+
exposes: "Hosts behind the public surface (localhost, private IPs, *.internal, staging) that hint at infrastructure worth probing.",
|
|
97
|
+
recommendation: "Inject environment-specific URLs at build time and make sure production builds only contain production endpoints.",
|
|
98
|
+
},
|
|
99
|
+
// ── Electron ──────────────────────────────────────────────────────────────
|
|
100
|
+
{
|
|
101
|
+
id: "electron_app_unpacked",
|
|
102
|
+
name: "Electron app code shipped as plain files",
|
|
103
|
+
target: "electron",
|
|
104
|
+
category: "source-exposure",
|
|
105
|
+
severity: "high",
|
|
106
|
+
exposes: "The whole app as a readable resources/app directory that can be edited in place.",
|
|
107
|
+
recommendation: "Package the app into app.asar (electron-builder/forge do this by default) and enable the OnlyLoadAppFromAsar and EmbeddedAsarIntegrityValidation fuses.",
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
id: "electron_fuse_run_as_node",
|
|
111
|
+
name: "Electron RunAsNode fuse enabled",
|
|
112
|
+
target: "electron",
|
|
113
|
+
category: "tamper-resistance",
|
|
114
|
+
severity: "high",
|
|
115
|
+
exposes: "ELECTRON_RUN_AS_NODE=1 turns the signed app binary into a plain Node.js runtime that runs any script with the app's identity and permissions.",
|
|
116
|
+
recommendation: "Flip the RunAsNode fuse off with @electron/fuses (or electron-builder/forge fuse config).",
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "electron_fuse_inspect_args",
|
|
120
|
+
name: "Electron Node inspector arguments allowed",
|
|
121
|
+
target: "electron",
|
|
122
|
+
category: "debug-surface",
|
|
123
|
+
severity: "high",
|
|
124
|
+
exposes: "--inspect / --inspect-brk attach a full debugger to the main process: breakpoints, memory and live code inside the shipped app.",
|
|
125
|
+
recommendation: "Flip the EnableNodeCliInspectArguments fuse off.",
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: "electron_fuse_node_options",
|
|
129
|
+
name: "Electron honours NODE_OPTIONS",
|
|
130
|
+
target: "electron",
|
|
131
|
+
category: "tamper-resistance",
|
|
132
|
+
severity: "medium",
|
|
133
|
+
exposes: "NODE_OPTIONS=--require ./hook.js injects code into the main process before the app starts.",
|
|
134
|
+
recommendation: "Flip the EnableNodeOptionsEnvironmentVariable fuse off.",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: "electron_fuse_asar_integrity_off",
|
|
138
|
+
name: "Electron ASAR integrity validation off",
|
|
139
|
+
target: "electron",
|
|
140
|
+
category: "tamper-resistance",
|
|
141
|
+
severity: "medium",
|
|
142
|
+
exposes: "app.asar can be unpacked, patched and repacked without the signed binary noticing.",
|
|
143
|
+
recommendation: "Enable the EnableEmbeddedAsarIntegrityValidation fuse (requires a recent electron-builder/forge that writes the integrity hash).",
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: "electron_fuse_load_outside_asar",
|
|
147
|
+
name: "Electron may load the app from outside the ASAR",
|
|
148
|
+
target: "electron",
|
|
149
|
+
category: "tamper-resistance",
|
|
150
|
+
severity: "medium",
|
|
151
|
+
exposes: "Dropping a resources/app folder next to app.asar replaces the app code without touching the archive.",
|
|
152
|
+
recommendation: "Enable the OnlyLoadAppFromAsar fuse.",
|
|
153
|
+
},
|
|
154
|
+
// ── Android ───────────────────────────────────────────────────────────────
|
|
155
|
+
{
|
|
156
|
+
id: "apk_debuggable",
|
|
157
|
+
name: "APK is debuggable",
|
|
158
|
+
target: "android",
|
|
159
|
+
category: "debug-surface",
|
|
160
|
+
severity: "critical",
|
|
161
|
+
exposes: "Any device can attach a Java/native debugger, run-as into the app's private data and inspect it live.",
|
|
162
|
+
recommendation: "Ship a release build; never set android:debuggable=\"true\" (it is set automatically on debug builds).",
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: "apk_no_obfuscation",
|
|
166
|
+
name: "App classes are not obfuscated",
|
|
167
|
+
target: "android",
|
|
168
|
+
category: "obfuscation",
|
|
169
|
+
severity: "high",
|
|
170
|
+
exposes: "jadx output that reads like the original Kotlin/Java: class, method and field names intact.",
|
|
171
|
+
recommendation: "Enable R8 for the release build (isMinifyEnabled = true, isShrinkResources = true) and keep rules only for what reflection needs.",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "apk_js_bundle_plaintext",
|
|
175
|
+
name: "React Native bundle shipped as plain JavaScript",
|
|
176
|
+
target: "android",
|
|
177
|
+
category: "source-exposure",
|
|
178
|
+
severity: "high",
|
|
179
|
+
exposes: "assets/index.android.bundle is readable JavaScript containing the app's business logic.",
|
|
180
|
+
recommendation: "Enable Hermes so the bundle ships as bytecode, and minify it.",
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
id: "apk_unsigned",
|
|
184
|
+
name: "APK is not signed",
|
|
185
|
+
target: "android",
|
|
186
|
+
category: "tamper-resistance",
|
|
187
|
+
severity: "high",
|
|
188
|
+
exposes: "There is no signature to break, so a modified copy is indistinguishable from the original.",
|
|
189
|
+
recommendation: "Sign release builds with APK Signature Scheme v2 or later (Play App Signing does this for bundles).",
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
id: "apk_v1_only_signature",
|
|
193
|
+
name: "APK signed with JAR (v1) scheme only",
|
|
194
|
+
target: "android",
|
|
195
|
+
category: "tamper-resistance",
|
|
196
|
+
severity: "medium",
|
|
197
|
+
exposes: "v1 signatures do not cover the whole file (Janus, CVE-2017-13156), so repackaging tricks stay possible on older devices.",
|
|
198
|
+
recommendation: "Enable v2/v3 signing (default in current Android Gradle Plugin) and raise minSdk where you can.",
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
id: "apk_allow_backup",
|
|
202
|
+
name: "App data can be pulled through backup",
|
|
203
|
+
target: "android",
|
|
204
|
+
category: "debug-surface",
|
|
205
|
+
severity: "medium",
|
|
206
|
+
exposes: "adb backup / device transfer copies the app's private databases, preferences and tokens for offline analysis.",
|
|
207
|
+
recommendation: "Set android:allowBackup=\"false\", or define dataExtractionRules/fullBackupContent that exclude sensitive files.",
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
id: "apk_test_only",
|
|
211
|
+
name: "APK marked testOnly",
|
|
212
|
+
target: "android",
|
|
213
|
+
category: "debug-surface",
|
|
214
|
+
severity: "low",
|
|
215
|
+
exposes: "A test build left in a distributed package; such builds usually carry other debug affordances too.",
|
|
216
|
+
recommendation: "Distribute release builds only; testOnly is set by the IDE for run configurations.",
|
|
217
|
+
},
|
|
218
|
+
// ── Native binaries (ELF, Mach-O, PE) ──────────────────────────────────────
|
|
219
|
+
{
|
|
220
|
+
id: "native_debug_info",
|
|
221
|
+
name: "Debug information shipped in the binary",
|
|
222
|
+
target: "native",
|
|
223
|
+
category: "source-exposure",
|
|
224
|
+
severity: "high",
|
|
225
|
+
exposes: "DWARF/PDB data maps machine code back to source files, line numbers, types and local variable names.",
|
|
226
|
+
recommendation: "Strip debug info from release artifacts (strip -S / -g, dsymutil + strip on macOS, /DEBUG with a separate PDB on Windows) and keep symbols in a private symbol server.",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
id: "native_symbols_not_stripped",
|
|
230
|
+
name: "Symbol table not stripped",
|
|
231
|
+
target: "native",
|
|
232
|
+
category: "obfuscation",
|
|
233
|
+
severity: "medium",
|
|
234
|
+
exposes: "Internal function names label the disassembly, which is most of the work a reverse engineer does by hand.",
|
|
235
|
+
recommendation: "Strip local symbols in release builds (strip, -Wl,-s, -Wl,-dead_strip -Wl,-x on macOS) and build with -fvisibility=hidden.",
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
id: "native_debuggable_entitlement",
|
|
239
|
+
name: "get-task-allow entitlement present",
|
|
240
|
+
target: "native",
|
|
241
|
+
category: "debug-surface",
|
|
242
|
+
severity: "high",
|
|
243
|
+
exposes: "macOS lets any process of the same user attach a debugger (lldb) and read the app's memory.",
|
|
244
|
+
recommendation: "Sign release builds without com.apple.security.get-task-allow (Xcode adds it only to Debug).",
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "native_no_hardened_runtime",
|
|
248
|
+
name: "macOS executable without the Hardened Runtime",
|
|
249
|
+
target: "native",
|
|
250
|
+
category: "tamper-resistance",
|
|
251
|
+
severity: "medium",
|
|
252
|
+
exposes: "DYLD_INSERT_LIBRARIES injection and debugger attachment are not blocked by the OS.",
|
|
253
|
+
recommendation: "Sign with --options runtime (required for notarization) and avoid the disable-library-validation / allow-dyld-environment-variables exceptions.",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
id: "native_injection_entitlement",
|
|
257
|
+
name: "Entitlement that re-opens code injection",
|
|
258
|
+
target: "native",
|
|
259
|
+
category: "tamper-resistance",
|
|
260
|
+
severity: "medium",
|
|
261
|
+
exposes: "disable-library-validation or allow-dyld-environment-variables lets unsigned dylibs load into the process.",
|
|
262
|
+
recommendation: "Remove the entitlement; if a plug-in model needs it, load plug-ins in a separate helper process.",
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
id: "native_unsigned",
|
|
266
|
+
name: "Binary is not code-signed",
|
|
267
|
+
target: "native",
|
|
268
|
+
category: "tamper-resistance",
|
|
269
|
+
severity: "medium",
|
|
270
|
+
exposes: "Patched copies of the binary run without any OS warning.",
|
|
271
|
+
recommendation: "Code-sign release binaries (Developer ID on macOS, Authenticode on Windows).",
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: "native_adhoc_signed",
|
|
275
|
+
name: "Binary is only ad-hoc signed",
|
|
276
|
+
target: "native",
|
|
277
|
+
category: "tamper-resistance",
|
|
278
|
+
severity: "low",
|
|
279
|
+
exposes: "An ad-hoc signature has no identity; anyone can re-sign a patched copy the same way.",
|
|
280
|
+
recommendation: "Sign with a Developer ID certificate and notarize.",
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
id: "native_build_path_leak",
|
|
284
|
+
name: "Build machine path embedded in the binary",
|
|
285
|
+
target: "native",
|
|
286
|
+
category: "debug-surface",
|
|
287
|
+
severity: "low",
|
|
288
|
+
exposes: "The PDB path reveals the build host's directory layout, user name and project structure.",
|
|
289
|
+
recommendation: "Use /PDBALTPATH:%_PDB% (MSVC) or -fdebug-prefix-map / -ffile-prefix-map to strip build paths.",
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
id: "native_no_pie",
|
|
293
|
+
name: "Executable is not position-independent",
|
|
294
|
+
target: "native",
|
|
295
|
+
category: "binary-hardening",
|
|
296
|
+
severity: "medium",
|
|
297
|
+
exposes: "Fixed load addresses make every address found during analysis directly reusable in an exploit.",
|
|
298
|
+
recommendation: "Build with -fPIE -pie (ELF), keep MH_PIE on macOS, and /DYNAMICBASE on Windows.",
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
id: "native_no_nx",
|
|
302
|
+
name: "Stack/data not marked non-executable",
|
|
303
|
+
target: "native",
|
|
304
|
+
category: "binary-hardening",
|
|
305
|
+
severity: "medium",
|
|
306
|
+
exposes: "Injected code on the stack or heap can run directly.",
|
|
307
|
+
recommendation: "Link with -z noexecstack (ELF) or /NXCOMPAT (Windows).",
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "native_no_relro",
|
|
311
|
+
name: "No RELRO",
|
|
312
|
+
target: "native",
|
|
313
|
+
category: "binary-hardening",
|
|
314
|
+
severity: "low",
|
|
315
|
+
exposes: "The GOT stays writable, a classic target for redirecting calls after memory corruption.",
|
|
316
|
+
recommendation: "Link with -Wl,-z,relro,-z,now.",
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
id: "native_no_stack_canary",
|
|
320
|
+
name: "No stack protector",
|
|
321
|
+
target: "native",
|
|
322
|
+
category: "binary-hardening",
|
|
323
|
+
severity: "low",
|
|
324
|
+
exposes: "Stack buffer overflows overwrite return addresses without detection.",
|
|
325
|
+
recommendation: "Compile with -fstack-protector-strong.",
|
|
326
|
+
},
|
|
327
|
+
// ── .NET ──────────────────────────────────────────────────────────────────
|
|
328
|
+
{
|
|
329
|
+
id: "dotnet_not_obfuscated",
|
|
330
|
+
name: ".NET assembly is not obfuscated",
|
|
331
|
+
target: "dotnet",
|
|
332
|
+
category: "obfuscation",
|
|
333
|
+
severity: "high",
|
|
334
|
+
exposes: "ILSpy/dnSpy decompile it to C# that is close to the original, names included.",
|
|
335
|
+
recommendation: "Run an obfuscator in the release pipeline (e.g. Obfuscar, ConfuserEx 2, a commercial protector) or publish with NativeAOT where the app allows it.",
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
id: "dotnet_embedded_pdb",
|
|
339
|
+
name: ".NET assembly embeds its PDB",
|
|
340
|
+
target: "dotnet",
|
|
341
|
+
category: "source-exposure",
|
|
342
|
+
severity: "high",
|
|
343
|
+
exposes: "Embedded portable PDB gives decompilers local variable names, source paths and sometimes the source itself.",
|
|
344
|
+
recommendation: "Set <DebugType>none</DebugType> (or portable, shipped separately) for Release, and do not set EmbedAllSources.",
|
|
345
|
+
},
|
|
346
|
+
];
|
|
347
|
+
const RULE_BY_ID = new Map(RULES.map((r) => [r.id, r]));
|
|
348
|
+
export function getRule(id) {
|
|
349
|
+
const rule = RULE_BY_ID.get(id);
|
|
350
|
+
if (!rule)
|
|
351
|
+
throw new Error(`Unknown rule: ${id}`);
|
|
352
|
+
return rule;
|
|
353
|
+
}
|
|
354
|
+
//# sourceMappingURL=rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../src/rules.ts"],"names":[],"mappings":"AAuBA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,KAAK,GAAW;IAC3B,8EAA8E;IAC9E;QACE,EAAE,EAAE,yBAAyB;QAC7B,IAAI,EAAE,2CAA2C;QACjD,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,UAAU;QACpB,OAAO,EAAE,sGAAsG;QAC/G,cAAc,EAAE,6MAA6M;KAC9N;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,IAAI,EAAE,mCAAmC;QACzC,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,4GAA4G;QACrH,cAAc,EAAE,gHAAgH;KACjI;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,IAAI,EAAE,0CAA0C;QAChD,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,kFAAkF;QAC3F,cAAc,EAAE,wHAAwH;KACzI;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,IAAI,EAAE,mCAAmC;QACzC,MAAM,EAAE,KA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EAAE,wCAAwC;KACzD;IAED,6EAA6E;IAC7E;QACE,EAAE,EAAE,uBAAuB;QAC3B,IAAI,EAAE,iCAAiC;QACvC,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,aAAa;QACvB,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,+EAA+E;QACxF,cAAc,EAAE,oJAAoJ;KACrK;IACD;QACE,EAAE,EAAE,qBAAqB;QACzB,IAAI,EAAE,8BAA8B;QACpC,MAAM,EAAE,QAAQ;QAChB,QAAQ,EAAE,iBAAiB;QAC3B,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,6GAA6G;QACtH,cAAc,EAAE,gHAAgH;KACjI;CACF,CAAC;AAEF,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;AAExD,MAAM,UAAU,OAAO,CAAC,EAAU;IAChC,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,iBAAiB,EAAE,EAAE,CAAC,CAAC;IAClD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/sarif.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sarif.d.ts","sourceRoot":"","sources":["../src/sarif.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AA6B5C,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,MAAM,CAwD3E"}
|
package/dist/sarif.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
function severityToLevel(sev) {
|
|
2
|
+
if (sev === "critical" || sev === "high")
|
|
3
|
+
return "error";
|
|
4
|
+
if (sev === "medium")
|
|
5
|
+
return "warning";
|
|
6
|
+
return "note";
|
|
7
|
+
}
|
|
8
|
+
export function buildSarif(toolVersion, findings) {
|
|
9
|
+
const rulesMap = new Map();
|
|
10
|
+
const results = [];
|
|
11
|
+
for (const f of findings) {
|
|
12
|
+
if (!rulesMap.has(f.patternId)) {
|
|
13
|
+
rulesMap.set(f.patternId, {
|
|
14
|
+
id: f.patternId,
|
|
15
|
+
name: f.patternName.replace(/[^a-zA-Z0-9]/g, ""),
|
|
16
|
+
shortDescription: { text: f.patternName },
|
|
17
|
+
fullDescription: { text: f.recommendation },
|
|
18
|
+
helpUri: "https://guardbee.ai/docs/reverse-shield",
|
|
19
|
+
properties: {
|
|
20
|
+
"problem.severity": f.severity,
|
|
21
|
+
tags: ["security", "reverse-engineering", f.target, f.category],
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
const result = {
|
|
26
|
+
ruleId: f.patternId,
|
|
27
|
+
level: severityToLevel(f.severity),
|
|
28
|
+
message: { text: f.match ? `${f.patternName} — ${f.match} — ${f.recommendation}` : `${f.patternName} — ${f.recommendation}` },
|
|
29
|
+
};
|
|
30
|
+
if (f.file) {
|
|
31
|
+
result.locations = [
|
|
32
|
+
{
|
|
33
|
+
physicalLocation: {
|
|
34
|
+
artifactLocation: { uri: f.file, uriBaseId: "%SRCROOT%" },
|
|
35
|
+
region: { startLine: f.line, startColumn: f.column },
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
results.push(result);
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
$schema: "https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json",
|
|
44
|
+
version: "2.1.0",
|
|
45
|
+
runs: [
|
|
46
|
+
{
|
|
47
|
+
tool: {
|
|
48
|
+
driver: {
|
|
49
|
+
name: "@guardbee/mcp-reverse-shield",
|
|
50
|
+
version: toolVersion,
|
|
51
|
+
informationUri: "https://guardbee.ai",
|
|
52
|
+
rules: Array.from(rulesMap.values()),
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
results,
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=sarif.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sarif.js","sourceRoot":"","sources":["../src/sarif.ts"],"names":[],"mappings":"AAuBA,SAAS,eAAe,CAAC,GAAW;IAClC,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,MAAM;QAAE,OAAO,OAAO,CAAC;IACzD,IAAI,GAAG,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,WAAmB,EAAE,QAAmB;IACjE,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAqB,CAAC;IAC9C,MAAM,OAAO,GAAkB,EAAE,CAAC;IAElC,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;YAC/B,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE;gBACxB,EAAE,EAAE,CAAC,CAAC,SAAS;gBACf,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;gBAChD,gBAAgB,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE;gBACzC,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,cAAc,EAAE;gBAC3C,OAAO,EAAE,yCAAyC;gBAClD,UAAU,EAAE;oBACV,kBAAkB,EAAE,CAAC,CAAC,QAAQ;oBAC9B,IAAI,EAAE,CAAC,UAAU,EAAE,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE,C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
+
export interface ScanOptions {
|
|
4
|
+
maxFiles?: number;
|
|
5
|
+
include?: string[];
|
|
6
|
+
exclude?: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface ScanResult {
|
|
9
|
+
target: string;
|
|
10
|
+
/** What was recognised: web assets, an Electron app, an APK, native binaries, .NET assemblies. */
|
|
11
|
+
kinds: TargetKind[];
|
|
12
|
+
grade: "A" | "B" | "C" | "D" | "F";
|
|
13
|
+
scannedFiles: number;
|
|
14
|
+
totalFindings: number;
|
|
15
|
+
findings: Finding[];
|
|
16
|
+
/** Context that is not a finding: fuse states, signing scheme, obfuscator detected, files skipped. */
|
|
17
|
+
notes: string[];
|
|
18
|
+
truncated: boolean;
|
|
19
|
+
durationMs: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Scans a build artifact for what it gives away to a reverse engineer: a file
|
|
23
|
+
* (APK, ASAR, bundle, source map, ELF/Mach-O/PE/.NET binary), a macOS .app,
|
|
24
|
+
* an Electron app folder, or a build output directory containing any of them.
|
|
25
|
+
*/
|
|
26
|
+
export declare function scanPath(target: string, options?: ScanOptions): ScanResult;
|
|
27
|
+
//# sourceMappingURL=scanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../src/scanner.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAI7C,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,kGAAkG;IAClG,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACnC,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,sGAAsG;IACtG,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;AAkID;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,GAAE,WAAgB,GAAG,UAAU,CAyB9E"}
|