@code-sentinel-cli/code-sentinel-cli 4.0.9 → 4.0.11

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.
Files changed (79) hide show
  1. package/dist/bin.js +7204 -914
  2. package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.rule.yaml +1 -0
  3. package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.rule.yaml +1 -0
  4. package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.rule.yaml +1 -0
  5. package/dist/builtin-rules/ai/spring-boot/state-transition-guard-risk.rule.yaml +1 -0
  6. package/dist/builtin-rules/fortify/ai/angular/cross-feature-route-permission-drift.rule.yaml +2 -0
  7. package/dist/builtin-rules/fortify/ai/angular/route-permission-flow.rule.yaml +2 -0
  8. package/dist/builtin-rules/fortify/ai/spring-boot/io-boundary-risk.rule.yaml +1 -0
  9. package/dist/builtin-rules/fortify/ai/spring-boot/security-redirect-risk.rule.yaml +2 -0
  10. package/dist/builtin-rules/fortify/ai/spring-boot/security-sensitive-data-risk.rule.yaml +2 -0
  11. package/dist/builtin-rules/fortify/static/angular/sensitive-input-masking.rule.js +1 -0
  12. package/dist/builtin-rules/fortify/static/general/java-weak-randomness.rule.js +2 -0
  13. package/dist/builtin-rules/fortify/static/general/no-client-identity-header.rule.js +1 -0
  14. package/dist/builtin-rules/fortify/static/general/no-guessable-websql-database-name.rule.js +1 -0
  15. package/dist/builtin-rules/fortify/static/general/no-reflective-access-override.rule.js +1 -0
  16. package/dist/builtin-rules/fortify/static/general/no-sensitive-string-materialization.rule.js +1 -0
  17. package/dist/builtin-rules/fortify/static/spring-boot/no-command-injection.rule.js +2 -0
  18. package/dist/builtin-rules/fortify/static/spring-boot/no-path-traversal.rule.js +8 -1
  19. package/dist/builtin-rules/fortify/static/spring-boot/no-servlet-xss.rule.js +2 -0
  20. package/dist/builtin-rules/fortify/static/spring-boot/no-spel-injection.rule.js +2 -0
  21. package/dist/builtin-rules/fortify/static/spring-boot/no-sql-string-concat.rule.js +2 -0
  22. package/dist/builtin-rules/fortify/static/spring-boot/no-ssrf.rule.js +2 -0
  23. package/dist/builtin-rules/fortify/static/spring-boot/no-trust-boundary-violation.rule.js +43 -0
  24. package/dist/builtin-rules/fortify/static/spring-boot/no-weak-tls-protocol.rule.js +2 -0
  25. package/dist/builtin-rules/static/angular/no-dom-xss.rule.js +1 -0
  26. package/dist/builtin-rules/static/angular/template-dom-xss.rule.js +1 -0
  27. package/dist/builtin-rules/static/flutter/INVENTORY.md +44 -0
  28. package/dist/builtin-rules/static/flutter/NATIVE-INVENTORY.md +34 -0
  29. package/dist/builtin-rules/static/flutter/android-cleartext-traffic.rule.js +105 -0
  30. package/dist/builtin-rules/static/flutter/android-debug-certificate-risk.rule.js +1 -0
  31. package/dist/builtin-rules/static/flutter/android-exported-component.rule.js +1 -0
  32. package/dist/builtin-rules/static/flutter/android-manifest-hardening.rule.js +1 -0
  33. package/dist/builtin-rules/static/flutter/android-minsdk-low.rule.js +1 -0
  34. package/dist/builtin-rules/static/flutter/android-release-debuggable.rule.js +86 -0
  35. package/dist/builtin-rules/static/flutter/android-sensitive-permissions.rule.js +1 -0
  36. package/dist/builtin-rules/static/flutter/bad-certificate-callback.rule.js +81 -0
  37. package/dist/builtin-rules/static/flutter/biometric-without-crypto-object.rule.js +87 -0
  38. package/dist/builtin-rules/static/flutter/cleartext-http-endpoint.rule.js +77 -0
  39. package/dist/builtin-rules/static/flutter/debug-tooling-release-risk.rule.js +12 -3
  40. package/dist/builtin-rules/static/flutter/device-fingerprint-collection.rule.js +74 -0
  41. package/dist/builtin-rules/static/flutter/dynamic-archive-risk.rule.js +1 -0
  42. package/dist/builtin-rules/static/flutter/exported-content-provider-leak.rule.js +119 -0
  43. package/dist/builtin-rules/static/flutter/hardcoded-crypto-key.rule.js +125 -0
  44. package/dist/builtin-rules/static/flutter/hardcoded-oauth-client-secret.rule.js +108 -0
  45. package/dist/builtin-rules/static/flutter/hive-sensitive-storage.rule.js +1 -0
  46. package/dist/builtin-rules/static/flutter/insecure-deep-link.rule.js +154 -0
  47. package/dist/builtin-rules/static/flutter/ios-ats-exception.rule.js +83 -0
  48. package/dist/builtin-rules/static/flutter/ios-pasteboard-leak.rule.js +96 -0
  49. package/dist/builtin-rules/static/flutter/ios-privacy-hardening.rule.js +1 -0
  50. package/dist/builtin-rules/static/flutter/missing-enforced-update.rule.js +81 -0
  51. package/dist/builtin-rules/static/flutter/oauth-missing-pkce.rule.js +75 -0
  52. package/dist/builtin-rules/static/flutter/packaged-env-risk.rule.js +1 -0
  53. package/dist/builtin-rules/static/flutter/sensitive-log-leak.rule.js +1 -0
  54. package/dist/builtin-rules/static/flutter/token-insecure-storage.rule.js +121 -0
  55. package/dist/builtin-rules/static/flutter/tracking-sdk-init.rule.js +76 -0
  56. package/dist/builtin-rules/static/flutter/weak-mobile-crypto-algorithm.rule.js +114 -0
  57. package/dist/builtin-rules/static/flutter/weak-prng-mobile.rule.js +104 -0
  58. package/dist/builtin-rules/static/flutter/webview-bridge-guard.rule.js +1 -0
  59. package/dist/builtin-rules/static/general/dockerfile-dependency-confusion.rule.js +5 -4
  60. package/dist/builtin-rules/static/general/dockerfile-no-root-user.rule.js +1 -0
  61. package/dist/builtin-rules/static/general/kubernetes-pod-security.rule.js +1 -0
  62. package/dist/builtin-rules/static/general/no-dynamic-code-eval.rule.js +1 -0
  63. package/dist/builtin-rules/static/general/no-empty-encryption-key.rule.js +16 -1
  64. package/dist/builtin-rules/static/general/no-hardcoded-secret.rule.js +72 -9
  65. package/dist/builtin-rules/static/general/no-insecure-external-link.rule.js +1 -0
  66. package/dist/builtin-rules/static/general/no-insecure-password-submission.rule.js +34 -2
  67. package/dist/builtin-rules/static/general/no-unsafe-html-sink.rule.js +1 -0
  68. package/dist/builtin-rules/static/general/no-unused-export.rule.js +1 -0
  69. package/dist/builtin-rules/static/general/openapi-https-credentials.rule.js +1 -0
  70. package/dist/builtin-rules/static/general/sensitive-exception-response.rule.js +1 -0
  71. package/dist/builtin-rules/static/general/sensitive-output-exposure.rule.js +1 -0
  72. package/dist/builtin-rules/static/spring-boot/no-devtools-in-production.rule.js +1 -0
  73. package/dist/builtin-rules/static/spring-boot/no-unsafe-shared-formatter.rule.js +1 -0
  74. package/dist/builtin-rules/static/spring-boot/no-unzoned-datetime.rule.js +1 -0
  75. package/dist/builtin-rules/static/spring-boot/validate-input.rule.js +1 -0
  76. package/dist/index.d.ts +467 -0
  77. package/dist/index.js +7203 -913
  78. package/node_modules/@code-sentinel/parsers/index.js +81 -4
  79. package/package.json +1 -1
@@ -0,0 +1,75 @@
1
+ // builtin-rules/static/flutter/utils.js
2
+ var lineColumnAt = (content, index) => {
3
+ const safeIndex = Math.max(0, Math.min(index, content.length));
4
+ const before = content.slice(0, safeIndex);
5
+ const lines = before.split(/\r?\n/);
6
+ return { line: lines.length, column: lines.at(-1)?.length ?? 0 };
7
+ };
8
+ var finding = (file, index, message, suggestion, opts = {}) => {
9
+ const range = lineColumnAt(file.content, index);
10
+ return {
11
+ message,
12
+ file: file.path,
13
+ range,
14
+ suggestion,
15
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
16
+ ...opts.severity !== void 0 ? { severity: opts.severity } : {},
17
+ ...opts.snippet !== void 0 ? { snippet: opts.snippet } : {},
18
+ ...opts.rootCauseKey !== void 0 ? { rootCauseKey: opts.rootCauseKey } : {},
19
+ ...opts.tags !== void 0 ? { tags: opts.tags } : {},
20
+ ...opts.profileApplicability !== void 0 ? { profileApplicability: opts.profileApplicability } : {}
21
+ };
22
+ };
23
+
24
+ // builtin-rules/static/flutter/oauth-missing-pkce.rule.ts
25
+ var OAUTH_REQUEST_RE = /(AuthorizationTokenRequest|AuthorizationRequest|OIDAuthorizationRequest|AuthorizationService\.|AppAuth|flutter_appauth)/;
26
+ var PKCE_PRESENT_RE = /(codeChallenge|code_challenge|codeVerifier|code_verifier|PkceS256|PkcePlain|pkceMethod|PKCE)/i;
27
+ var rule = {
28
+ id: "flutter/oauth-missing-pkce",
29
+ version: 1,
30
+ kind: "static-ts",
31
+ title: "OAuth/OIDC tr\xEAn mobile public client c\u1EA7n PKCE",
32
+ description: "M\u1ED9t authorization request qua AppAuth/flutter_appauth/OIDAuthorizationRequest m\xE0 kh\xF4ng khai codeChallenge/codeVerifier (PKCE) cho ph\xE9p k\u1EBB t\u1EA5n c\xF4ng \u0111\xE1nh c\u1EAFp authorization code qua custom-scheme redirect.",
33
+ severity: "warning",
34
+ category: "mobile-security",
35
+ languages: ["dart", "kotlin", "swift", "java"],
36
+ scope: "flutter",
37
+ requires: "text",
38
+ masvsControlIds: ["MASVS-AUTH-1"],
39
+ baseConfidence: 75,
40
+ check(ctx) {
41
+ const content = ctx.file.content;
42
+ if (!OAUTH_REQUEST_RE.test(content)) return [];
43
+ if (PKCE_PRESENT_RE.test(content)) return [];
44
+ const lines = content.split(/\r?\n/);
45
+ const out = [];
46
+ let offset = 0;
47
+ for (let i = 0; i < lines.length; i += 1) {
48
+ const line = lines[i] ?? "";
49
+ const oauthCall = /(AuthorizationTokenRequest|AuthorizationRequest|OIDAuthorizationRequest)\s*\(/.test(
50
+ line
51
+ ) || /AuthorizationService\.\w*Token/.test(line);
52
+ if (oauthCall) {
53
+ out.push(
54
+ finding(
55
+ ctx.file,
56
+ offset,
57
+ "Mobile OAuth/OIDC request kh\xF4ng c\xF3 PKCE (codeChallenge/codeVerifier).",
58
+ "Th\xEAm PKCE: Flutter AppAuth `codeChallenge`/`codeVerifier`; AppAuth Android/iOS thi\u1EBFt l\u1EADp `setCodeVerifier`/`additionalParameters` PKCE S256; kh\xF4ng bao gi\u1EDD thay PKCE b\u1EB1ng client_secret nh\xFAng trong app.",
59
+ {
60
+ snippet: line.trim(),
61
+ rootCauseKey: "oauth-pkce-missing",
62
+ tags: ["authentication", "oauth", "pkce"]
63
+ }
64
+ )
65
+ );
66
+ }
67
+ offset += line.length + 1;
68
+ }
69
+ return out;
70
+ }
71
+ };
72
+
73
+ export { rule };
74
+ //# sourceMappingURL=oauth-missing-pkce.rule.js.map
75
+ //# sourceMappingURL=oauth-missing-pkce.rule.js.map
@@ -40,6 +40,7 @@ var rule = {
40
40
  languages: ["yaml", "text", "shell"],
41
41
  scope: "flutter",
42
42
  requires: "text",
43
+ masvsControlIds: ["MASVS-STORAGE-2"],
43
44
  baseConfidence: 80,
44
45
  check(ctx) {
45
46
  const path = ctx.file.path.replace(/\\/g, "/").toLowerCase();
@@ -42,6 +42,7 @@ var rule = {
42
42
  languages: ["dart", "kotlin", "swift", "java", "objective-c"],
43
43
  scope: "flutter",
44
44
  requires: "text",
45
+ masvsControlIds: ["MASVS-STORAGE-2"],
45
46
  baseConfidence: 78,
46
47
  check(ctx) {
47
48
  const lines = ctx.file.content.split(/\r?\n/);
@@ -0,0 +1,121 @@
1
+ // builtin-rules/static/flutter/utils.js
2
+ var lineColumnAt = (content, index) => {
3
+ const safeIndex = Math.max(0, Math.min(index, content.length));
4
+ const before = content.slice(0, safeIndex);
5
+ const lines = before.split(/\r?\n/);
6
+ return { line: lines.length, column: lines.at(-1)?.length ?? 0 };
7
+ };
8
+ var finding = (file, index, message, suggestion, opts = {}) => {
9
+ const range = lineColumnAt(file.content, index);
10
+ return {
11
+ message,
12
+ file: file.path,
13
+ range,
14
+ suggestion,
15
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
16
+ ...opts.severity !== void 0 ? { severity: opts.severity } : {},
17
+ ...opts.snippet !== void 0 ? { snippet: opts.snippet } : {},
18
+ ...opts.rootCauseKey !== void 0 ? { rootCauseKey: opts.rootCauseKey } : {},
19
+ ...opts.tags !== void 0 ? { tags: opts.tags } : {},
20
+ ...opts.profileApplicability !== void 0 ? { profileApplicability: opts.profileApplicability } : {}
21
+ };
22
+ };
23
+
24
+ // builtin-rules/static/flutter/token-insecure-storage.rule.ts
25
+ var SETTER_RE = /\b(?:setString|setInt|setBool|setDouble|setStringList|writeAsString(?:Sync|Lines)?|writeAsBytes(?:Sync)?|setData)\b|Clipboard\.setData/;
26
+ var SENSITIVE_WORDS = /* @__PURE__ */ new Set([
27
+ "token",
28
+ "tokens",
29
+ "password",
30
+ "passwords",
31
+ "passwd",
32
+ "secret",
33
+ "secrets",
34
+ "credential",
35
+ "credentials",
36
+ "jwt"
37
+ ]);
38
+ var SENSITIVE_COMPOUNDS = /* @__PURE__ */ new Set([
39
+ "apikey",
40
+ "apisecret",
41
+ "authkey",
42
+ "secretkey",
43
+ "clientsecret",
44
+ "signingsecret",
45
+ "refreshtoken",
46
+ "accesstoken",
47
+ "authtoken",
48
+ "idtoken"
49
+ ]);
50
+ var SENSITIVE_SUFFIXES = ["token", "password", "passwd", "secret", "credential"];
51
+ var SECURE_SINK_RE = /FlutterSecureStorage|flutter_secure_storage|EncryptedSharedPreferences|Keychain|Keystore|SecureStorage/;
52
+ var NON_SENSITIVE_NAME_RE = /\b(?:public|device|locale|theme|lang)[\w$]*\b/i;
53
+ var splitIdentifierWords = (identifier) => identifier.replace(/[$_]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/ +/).filter((word) => word.length > 0);
54
+ var isSensitiveIdentifier = (identifier) => {
55
+ if (NON_SENSITIVE_NAME_RE.test(identifier)) return false;
56
+ const words = splitIdentifierWords(identifier).map((word) => word.toLowerCase());
57
+ if (words.some((word) => SENSITIVE_WORDS.has(word))) return true;
58
+ if (words.some((word) => SENSITIVE_SUFFIXES.some((suffix) => word.endsWith(suffix)))) {
59
+ return true;
60
+ }
61
+ return words.some((_, i) => {
62
+ const next = words[i + 1];
63
+ return next !== void 0 && SENSITIVE_COMPOUNDS.has(words[i] + next);
64
+ });
65
+ };
66
+ var firstSensitiveIdentifier = (text) => {
67
+ for (const match of text.matchAll(/[$\w]{2,}/g)) {
68
+ const identifier = match[0];
69
+ if (identifier && isSensitiveIdentifier(identifier)) return identifier;
70
+ }
71
+ return null;
72
+ };
73
+ var rule = {
74
+ id: "flutter/token-insecure-storage",
75
+ version: 1,
76
+ kind: "static-ts",
77
+ title: "Token/m\u1EADt kh\u1EA9u ph\u1EA3i l\u01B0u trong secure storage, kh\xF4ng ph\u1EA3i SharedPreferences/file/clipboard",
78
+ description: "Ph\xE1t hi\u1EC7n token/password/secret/credential ghi v\xE0o SharedPreferences, file storage ho\u1EB7c clipboard thay v\xEC flutter_secure_storage (Keychain/Keystore).",
79
+ severity: "error",
80
+ category: "mobile-security",
81
+ languages: ["dart"],
82
+ scope: "flutter",
83
+ requires: "text",
84
+ masvsControlIds: ["MASVS-STORAGE-1"],
85
+ baseConfidence: 85,
86
+ check(ctx) {
87
+ const lines = ctx.file.content.split(/\r?\n/);
88
+ const out = [];
89
+ let offset = 0;
90
+ for (let i = 0; i < lines.length; i += 1) {
91
+ const line = lines[i] ?? "";
92
+ const hasSetter = SETTER_RE.test(line);
93
+ const hasSecureSink = SECURE_SINK_RE.test(line);
94
+ if (hasSetter && !hasSecureSink) {
95
+ const windowText = lines.slice(Math.max(0, i - 3), Math.min(lines.length, i + 4)).join("\n");
96
+ const sensitiveName = firstSensitiveIdentifier(line) ?? firstSensitiveIdentifier(windowText);
97
+ if (sensitiveName) {
98
+ out.push(
99
+ finding(
100
+ ctx.file,
101
+ offset,
102
+ `D\u1EEF li\u1EC7u nh\u1EA1y c\u1EA3m \`${sensitiveName}\` c\xF3 th\u1EC3 \u0111\u01B0\u1EE3c ghi v\xE0o storage kh\xF4ng m\xE3 h\xF3a (SharedPreferences/file/clipboard).`,
103
+ "Kh\xF4ng l\u01B0u token/password/secret/credential trong SharedPreferences, file plaintext ho\u1EB7c clipboard; d\xF9ng flutter_secure_storage (iOS Keychain / Android Keystore) ho\u1EB7c encrypted storage (ATTT #26, #51, #86).",
104
+ {
105
+ snippet: line.trim(),
106
+ rootCauseKey: "sensitive-token-insecure-storage",
107
+ tags: ["storage", "sensitive-data"]
108
+ }
109
+ )
110
+ );
111
+ }
112
+ }
113
+ offset += line.length + 1;
114
+ }
115
+ return out;
116
+ }
117
+ };
118
+
119
+ export { rule };
120
+ //# sourceMappingURL=token-insecure-storage.rule.js.map
121
+ //# sourceMappingURL=token-insecure-storage.rule.js.map
@@ -0,0 +1,76 @@
1
+ // builtin-rules/static/flutter/utils.js
2
+ var lineColumnAt = (content, index) => {
3
+ const safeIndex = Math.max(0, Math.min(index, content.length));
4
+ const before = content.slice(0, safeIndex);
5
+ const lines = before.split(/\r?\n/);
6
+ return { line: lines.length, column: lines.at(-1)?.length ?? 0 };
7
+ };
8
+ var finding = (file, index, message, suggestion, opts = {}) => {
9
+ const range = lineColumnAt(file.content, index);
10
+ return {
11
+ message,
12
+ file: file.path,
13
+ range,
14
+ suggestion,
15
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
16
+ ...opts.severity !== void 0 ? { severity: opts.severity } : {},
17
+ ...opts.snippet !== void 0 ? { snippet: opts.snippet } : {},
18
+ ...opts.rootCauseKey !== void 0 ? { rootCauseKey: opts.rootCauseKey } : {},
19
+ ...opts.tags !== void 0 ? { tags: opts.tags } : {},
20
+ ...opts.profileApplicability !== void 0 ? { profileApplicability: opts.profileApplicability } : {}
21
+ };
22
+ };
23
+
24
+ // builtin-rules/static/flutter/tracking-sdk-init.rule.ts
25
+ var TRACKING_SDK_INIT_RE = /\b(AppsFlyerLib|AppsFlyerLib\.getInstance\(\)\.init|Adjust\.onCreate|AdjustConfig\(|OneSignal\.initWithContext|OneSignal\.setAppId|FacebookSdk\.sdkInitialize|FacebookSdk\.setApplicationId|FirebaseAnalytics\.getInstance|FirebaseAnalytics\.setAnalyticsCollectionEnabled\(true\))\b/;
26
+ var CONSENT_GATE_RE = /(?:userConsent|analyticsConsent|[Rr]equireConsent|ConsentInformation|ConsentStatus|setAnalyticsCollectionEnabled\(false\)|AppConsent|gdpr|GDPR|ConsentDialog|ConsentDebugGeography)/;
27
+ var rule = {
28
+ id: "flutter/tracking-sdk-init",
29
+ version: 1,
30
+ kind: "static-ts",
31
+ title: "SDK tracking/analytics kh\u1EDFi t\u1EA1o m\xE0 kh\xF4ng c\xF3 c\u1ED5ng \u0111\u1ED3ng thu\u1EADn (consent)",
32
+ description: "AppsFlyer/Adjust/OneSignal/Facebook/Firebase Analytics kh\u1EDFi t\u1EA1o tr\u1EF1c ti\u1EBFp trong Application.onCreate / main / initState m\xE0 kh\xF4ng c\xF3 consent gate (requireConsent / setAnalyticsCollectionEnabled(false) / ConsentInformation). Thu th\u1EADp d\u1EEF li\u1EC7u tr\u01B0\u1EDBc \u0111\u1ED3ng thu\u1EADn vi ph\u1EA1m MASVS-PRIVACY-3.",
33
+ severity: "info",
34
+ category: "mobile-privacy",
35
+ languages: ["kotlin", "java", "dart", "swift"],
36
+ scope: "flutter",
37
+ requires: "text",
38
+ masvsControlIds: ["MASVS-PRIVACY-1"],
39
+ baseConfidence: 60,
40
+ check(ctx) {
41
+ if (/(?:^|\/)(?:debug|test|__tests__)\//i.test(ctx.file.path)) return [];
42
+ const lines = ctx.file.content.split(/\r?\n/);
43
+ const out = [];
44
+ let offset = 0;
45
+ for (let i = 0; i < lines.length; i += 1) {
46
+ const line = lines[i] ?? "";
47
+ if (!TRACKING_SDK_INIT_RE.test(line)) {
48
+ offset += line.length + 1;
49
+ continue;
50
+ }
51
+ if (CONSENT_GATE_RE.test(ctx.file.content)) {
52
+ offset += line.length + 1;
53
+ continue;
54
+ }
55
+ out.push(
56
+ finding(
57
+ ctx.file,
58
+ offset,
59
+ "Kh\u1EDFi t\u1EA1o SDK tracking/analytics kh\xF4ng th\u1EA5y consent gate trong file.",
60
+ "B\u1EADt requireConsent (Adjust/AppsFlyer), await ConsentInformation (Google UMP), ho\u1EB7c setAnalyticsCollectionEnabled(false) cho \u0111\u1EBFn khi ng\u01B0\u1EDDi d\xF9ng \u0111\u1ED3ng \xFD; ch\u1EC9 init collection sau khi c\xF3 consent.",
61
+ {
62
+ snippet: line.trim(),
63
+ rootCauseKey: "tracking-sdk-without-consent-gate",
64
+ tags: ["privacy", "consent", "tracking"]
65
+ }
66
+ )
67
+ );
68
+ offset += line.length + 1;
69
+ }
70
+ return out;
71
+ }
72
+ };
73
+
74
+ export { rule };
75
+ //# sourceMappingURL=tracking-sdk-init.rule.js.map
76
+ //# sourceMappingURL=tracking-sdk-init.rule.js.map
@@ -0,0 +1,114 @@
1
+ // builtin-rules/static/flutter/utils.js
2
+ var lineColumnAt = (content, index) => {
3
+ const safeIndex = Math.max(0, Math.min(index, content.length));
4
+ const before = content.slice(0, safeIndex);
5
+ const lines = before.split(/\r?\n/);
6
+ return { line: lines.length, column: lines.at(-1)?.length ?? 0 };
7
+ };
8
+ var finding = (file, index, message, suggestion, opts = {}) => {
9
+ const range = lineColumnAt(file.content, index);
10
+ return {
11
+ message,
12
+ file: file.path,
13
+ range,
14
+ suggestion,
15
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
16
+ ...opts.severity !== void 0 ? { severity: opts.severity } : {},
17
+ ...opts.snippet !== void 0 ? { snippet: opts.snippet } : {},
18
+ ...opts.rootCauseKey !== void 0 ? { rootCauseKey: opts.rootCauseKey } : {},
19
+ ...opts.tags !== void 0 ? { tags: opts.tags } : {},
20
+ ...opts.profileApplicability !== void 0 ? { profileApplicability: opts.profileApplicability } : {}
21
+ };
22
+ };
23
+
24
+ // builtin-rules/static/flutter/weak-mobile-crypto-algorithm.rule.ts
25
+ var WEAK_SPECS = [
26
+ // JCE Cipher.getInstance với ECB/DES/RC4/3DES/Blowfish/PKCS1-no-OAEP
27
+ [
28
+ /\bCipher\.getInstance\s*\(\s*['"][^'"]*\b(?:ECB|DES|DESede|3DES|RC4|ARCFOUR|Blowfish|RSA\/ECB\/PKCS1)/i,
29
+ "Cipher getInstance weak (ECB/DES/RC4/3DES/Blowfish/PKCS1 RSA)"
30
+ ],
31
+ // MessageDigest MD5/SHA-1
32
+ [/\bMessageDigest\.getInstance\s*\(\s*['"](?:MD5|SHA-?1)['"]/i, "MessageDigest MD5/SHA-1"],
33
+ // Mac HmacMD5/HmacSHA1
34
+ [/\bMac\.getInstance\s*\(\s*['"]Hmac(?:MD5|SHA-?1)['"]/i, "HmacMD5/HmacSHA1"],
35
+ // KeyGenerator DES/RC4/3DES (AES được phép)
36
+ [
37
+ /\bKeyGenerator\.getInstance\s*\(\s*['"](?:DES|ARCFOUR|RC4|DESede)['"]/i,
38
+ "KeyGenerator DES/RC4/3DES"
39
+ ],
40
+ // Dart crypto
41
+ [/\bHmac\s*\(\s*sha1\b/i, "Hmac(sha1)"],
42
+ [/\bDigest\s*\(\s*['"](?:SHA-?1|MD5)['"]/i, "Digest(SHA-1|MD5)"]
43
+ ];
44
+ var ECB_LITERAL_RE = /['"][^'"]*\bECB\b[^'"]*['"]/i;
45
+ var IGNORE_COMMENT_RE = /\/\/\s*secure-ignored\b/i;
46
+ var TEST_DEBUG_PATH_RE = /(?:^|\/)(?:test|debug)\//i;
47
+ var rule = {
48
+ id: "flutter/weak-mobile-crypto-algorithm",
49
+ version: 1,
50
+ kind: "static-ts",
51
+ title: "Kh\xF4ng d\xF9ng thu\u1EADt to\xE1n/mode m\xE3 h\xF3a y\u1EBFu (MD5/SHA-1/DES/RC4/ECB)",
52
+ description: "Ph\xE1t hi\u1EC7n thu\u1EADt to\xE1n b\u0103m/m\xE3 h\xF3a y\u1EBFu (MD5, SHA-1, HmacMD5, HmacSHA1), block/stream cipher y\u1EBFu (DES, RC4, 3DES, Blowfish) ho\u1EB7c mode ECB trong code mobile (Dart/Java/Kotlin). C\xE1c ch\u1ECDn l\u1EF1a n\xE0y kh\xF4ng \u0111\u1EA1t khuy\u1EBFn ngh\u1ECB MASVS-CRYPTO-1.",
53
+ severity: "error",
54
+ category: "mobile-security",
55
+ languages: ["dart", "java", "kotlin"],
56
+ scope: "flutter",
57
+ requires: "text",
58
+ masvsControlIds: ["MASVS-CRYPTO-2"],
59
+ baseConfidence: 88,
60
+ check(ctx) {
61
+ if (TEST_DEBUG_PATH_RE.test(ctx.file.path)) return [];
62
+ const lines = ctx.file.content.split(/\r?\n/);
63
+ const out = [];
64
+ let offset = 0;
65
+ for (let i = 0; i < lines.length; i += 1) {
66
+ const line = lines[i] ?? "";
67
+ if (IGNORE_COMMENT_RE.test(line)) {
68
+ offset += line.length + 1;
69
+ continue;
70
+ }
71
+ let emitted = false;
72
+ for (const [re, label] of WEAK_SPECS) {
73
+ if (re.test(line)) {
74
+ out.push(
75
+ finding(
76
+ ctx.file,
77
+ offset,
78
+ `Thu\u1EADt to\xE1n/mode m\xE3 h\xF3a y\u1EBFu (${label}) trong code mobile \u2014 kh\xF4ng \u0111\u1EA1t MASVS-CRYPTO-1 (ATTT #85/#40).`,
79
+ "D\xF9ng thu\u1EADt to\xE1n khuy\u1EBFn ngh\u1ECB: b\u0103m SHA-256 tr\u1EDF l\xEAn (ho\u1EB7c h\u1ECD SHA-3), m\xE3 h\xF3a \u0111\u1ED1i x\u1EE9ng AES v\u1EDBi mode an to\xE0n GCM/CBC+HMAC ho\u1EB7c ChaCha20-Poly1305, HMAC SHA-256+; tuy\u1EC7t \u0111\u1ED1i tr\xE1nh ECB; DES/RC4/3DES/Blowfish kh\xF4ng d\xF9ng cho d\u1EEF li\u1EC7u m\u1EDBi.",
80
+ {
81
+ snippet: line.trim(),
82
+ rootCauseKey: "weak-crypto-algorithm",
83
+ tags: ["crypto", "masvs-crypto"]
84
+ }
85
+ )
86
+ );
87
+ emitted = true;
88
+ break;
89
+ }
90
+ }
91
+ if (!emitted && ECB_LITERAL_RE.test(line) && !/\b(?:CBC|GCM|CTR|CCM|CFB|OFB)\b/i.test(line)) {
92
+ out.push(
93
+ finding(
94
+ ctx.file,
95
+ offset,
96
+ "Mode m\xE3 h\xF3a ECB trong code mobile \u2014 kh\xF4ng \u0111\u1EA1t MASVS-CRYPTO-1 (ATTT #85/#40).",
97
+ "Tr\xE1nh ECB ho\xE0n to\xE0n: n\xF3 r\xF2 r\u1EC9 pattern ciphertext v\xE0 kh\xF4ng \u0111\u1EA1t t\xEDnh ph\xE2n bi\u1EC7t (IND-CPA). D\xF9ng AES-GCM ho\u1EB7c AES-CBC + HMAC-SHA256 v\u1EDBi IV ng\u1EABu nhi\xEAn.",
98
+ {
99
+ snippet: line.trim(),
100
+ rootCauseKey: "weak-crypto-algorithm",
101
+ tags: ["crypto", "masvs-crypto"]
102
+ }
103
+ )
104
+ );
105
+ }
106
+ offset += line.length + 1;
107
+ }
108
+ return out;
109
+ }
110
+ };
111
+
112
+ export { rule };
113
+ //# sourceMappingURL=weak-mobile-crypto-algorithm.rule.js.map
114
+ //# sourceMappingURL=weak-mobile-crypto-algorithm.rule.js.map
@@ -0,0 +1,104 @@
1
+ // builtin-rules/static/flutter/utils.js
2
+ var lineColumnAt = (content, index) => {
3
+ const safeIndex = Math.max(0, Math.min(index, content.length));
4
+ const before = content.slice(0, safeIndex);
5
+ const lines = before.split(/\r?\n/);
6
+ return { line: lines.length, column: lines.at(-1)?.length ?? 0 };
7
+ };
8
+ var finding = (file, index, message, suggestion, opts = {}) => {
9
+ const range = lineColumnAt(file.content, index);
10
+ return {
11
+ message,
12
+ file: file.path,
13
+ range,
14
+ suggestion,
15
+ ...opts.confidence !== void 0 ? { confidence: opts.confidence } : {},
16
+ ...opts.severity !== void 0 ? { severity: opts.severity } : {},
17
+ ...opts.snippet !== void 0 ? { snippet: opts.snippet } : {},
18
+ ...opts.rootCauseKey !== void 0 ? { rootCauseKey: opts.rootCauseKey } : {},
19
+ ...opts.tags !== void 0 ? { tags: opts.tags } : {},
20
+ ...opts.profileApplicability !== void 0 ? { profileApplicability: opts.profileApplicability } : {}
21
+ };
22
+ };
23
+
24
+ // builtin-rules/static/flutter/weak-prng-mobile.rule.ts
25
+ var WEAK_PRNG_RE = /\b(?:new\s+Random\b|Random|ThreadLocalRandom|Math\.random|kotlin\.random\.Random|RandomStringUtils\.random(?:Numeric|Alphabetic|Ascii)?)\b\s*[\t ]*[(.]/;
26
+ var SECURE_PRNG_RE = /SecureRandom|\.secure\s*\(|java\.security\.SecureRandom|HKDF|\/dev\/urandom/i;
27
+ var SECURITY_WORDS = /* @__PURE__ */ new Set([
28
+ "otp",
29
+ "otps",
30
+ "token",
31
+ "tokens",
32
+ "secret",
33
+ "secrets",
34
+ "code",
35
+ "nonce",
36
+ "challenge",
37
+ "csrfstate",
38
+ "verifier",
39
+ "state",
40
+ "pin",
41
+ "pins",
42
+ "captcha"
43
+ ]);
44
+ var splitWords = (identifier) => identifier.replace(/[$_]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[^A-Za-z0-9]+/).filter((word) => word.length > 0);
45
+ var TEST_DEBUG_PATH_RE = /(?:^|\/)(?:test|debug)\//i;
46
+ var hasSecurityContext = (lines, center) => {
47
+ const start = Math.max(0, center - 3);
48
+ const end = Math.min(lines.length, center + 4);
49
+ for (let j = start; j < end; j += 1) {
50
+ const line = lines[j] ?? "";
51
+ const tokens = line.match(/[A-Za-z_$][A-Za-z0-9_$]{1,}/g) ?? [];
52
+ for (const tok of tokens) {
53
+ const words = splitWords(tok).map((w) => w.toLowerCase());
54
+ if (words.some((w) => SECURITY_WORDS.has(w))) return true;
55
+ }
56
+ }
57
+ return false;
58
+ };
59
+ var rule = {
60
+ id: "flutter/weak-prng-mobile",
61
+ version: 1,
62
+ kind: "static-ts",
63
+ title: "Sinh OTP/token/nonce/ph\xEA duy\u1EC7t ph\u1EA3i d\xF9ng PRNG an to\xE0n, kh\xF4ng ph\u1EA3i Random()/Math.random()",
64
+ description: "Ph\xE1t hi\u1EC7n `Random()`, `java.util.Random`, `Math.random()`, `ThreadLocalRandom` ho\u1EB7c `RandomStringUtils` khi trong c\u1EEDa s\u1ED5 \xB13 d\xF2ng c\xF3 identifier li\xEAn quan b\u1EA3o m\u1EADt (otp/token/secret/code/nonce/challenge/csrfState/verifier/state). PRNG y\u1EBFu kh\xF4ng kh\xE1ng \u0111o\xE1n l\u1EA1i attacker cho gi\xE1 tr\u1ECB b\u1EA3o m\u1EADt.",
65
+ severity: "error",
66
+ category: "mobile-security",
67
+ languages: ["dart", "java", "kotlin", "swift"],
68
+ scope: "flutter",
69
+ requires: "text",
70
+ masvsControlIds: ["MASVS-CRYPTO-2"],
71
+ baseConfidence: 85,
72
+ check(ctx) {
73
+ if (TEST_DEBUG_PATH_RE.test(ctx.file.path)) return [];
74
+ const lines = ctx.file.content.split(/\r?\n/);
75
+ const out = [];
76
+ let offset = 0;
77
+ for (let i = 0; i < lines.length; i += 1) {
78
+ const line = lines[i] ?? "";
79
+ if (WEAK_PRNG_RE.test(line) && !SECURE_PRNG_RE.test(line)) {
80
+ if (hasSecurityContext(lines, i)) {
81
+ out.push(
82
+ finding(
83
+ ctx.file,
84
+ offset,
85
+ "D\xF9ng PRNG y\u1EBFu (`Random()`/`Math.random()`/`ThreadLocalRandom`/`RandomStringUtils`) trong ng\u1EEF c\u1EA3nh sinh gi\xE1 tr\u1ECB b\u1EA3o m\u1EADt \u2014 kh\xF4ng kh\xE1ng \u0111o\xE1n l\u1EA1i attacker (ATTT #85; MASVS-CRYPTO-1).",
86
+ "D\xF9ng CSPRNG h\u1ED9i \u0111\u1ED3ng n\u1EC1n t\u1EA3ng: Dart `SecureRandom()` (package:crypto) ho\u1EB7c `Random.secure()`; Java `java.security.SecureRandom`; iOS `SecRandomCopyBytes`. Sinh OTP/nonce/PKCE verifier/state/PIN ch\u1EC9 d\xF9ng CSPRNG; trong Dart \u01B0u ti\xEAn `Random.secure()`.",
87
+ {
88
+ snippet: line.trim(),
89
+ rootCauseKey: "weak-prng-for-security",
90
+ tags: ["crypto", "prng", "masvs-crypto"]
91
+ }
92
+ )
93
+ );
94
+ }
95
+ }
96
+ offset += line.length + 1;
97
+ }
98
+ return out;
99
+ }
100
+ };
101
+
102
+ export { rule };
103
+ //# sourceMappingURL=weak-prng-mobile.rule.js.map
104
+ //# sourceMappingURL=weak-prng-mobile.rule.js.map
@@ -50,6 +50,7 @@ var rule = {
50
50
  languages: ["dart"],
51
51
  scope: "flutter",
52
52
  requires: "text",
53
+ masvsControlIds: ["MASVS-PLATFORM-3"],
53
54
  baseConfidence: 82,
54
55
  check(ctx) {
55
56
  const content = ctx.file.content;
@@ -3,12 +3,13 @@ import { DOCKERFILE_RE, auditDockerfileDependencyConfusion } from '@code-sentine
3
3
  // builtin-rules/static/general/dockerfile-dependency-confusion.rule.ts
4
4
  var rule = {
5
5
  id: "general/dockerfile-dependency-confusion",
6
- version: 3,
6
+ version: 4,
7
7
  kind: "static-ts",
8
8
  title: "Ng\u0103n ch\u1EB7n Dependency Confusion & Insecure Package Registry trong Dockerfile (CWE-427/CWE-829)",
9
9
  description: "Ph\xE1t hi\u1EC7n c\u1EA5u h\xECnh package manager kh\xF4ng an to\xE0n trong Dockerfile (nh\u01B0 `pip install --extra-index-url`, `--trusted-host`, ho\u1EB7c c\u1EA5u h\xECnh registry qua HTTP cleartext) d\u1EABn \u0111\u1EBFn nguy c\u01A1 Dependency Confusion, Package Squatting ho\u1EB7c Man-in-the-Middle.",
10
10
  severity: "error",
11
11
  category: "security",
12
+ sourceTools: ["fortify"],
12
13
  languages: ["text"],
13
14
  scope: "general",
14
15
  requires: "text",
@@ -23,9 +24,9 @@ var rule = {
23
24
  message: h.reason,
24
25
  file: file.path,
25
26
  range: { line: h.line, column: 1 },
26
- severity: "error",
27
- confidence: 90,
28
- suggestion: h.reason.includes("--extra-index-url") ? "Ch\u1EC9 s\u1EED d\u1EE5ng `--index-url` tr\u1ECF t\u1EDBi kho n\u1ED9i b\u1ED9 (artifact proxy) \u0111\xE3 \u0111\u01B0\u1EE3c b\u1EA3o v\u1EC7, ho\u1EB7c s\u1EED d\u1EE5ng c\u01A1 ch\u1EBF hash-pinning (`--require-hashes`)." : h.reason.includes("--trusted-host") ? "Cung c\u1EA5p ch\u1EE9ng ch\u1EC9 CA n\u1ED9i b\u1ED9 h\u1EE3p l\u1EC7 cho h\u1EC7 \u0111i\u1EC1u h\xE0nh/container thay v\xEC b\u1ECF qua ki\u1EC3m tra an to\xE0n v\u1EDBi `--trusted-host`." : "S\u1EED d\u1EE5ng HTTPS k\xE8m ch\u1EE9ng ch\u1EC9 SSL h\u1EE3p l\u1EC7 cho kho l\u01B0u tr\u1EEF g\xF3i (registry)."
27
+ severity: h.severity ?? "error",
28
+ confidence: h.confidence ?? 90,
29
+ suggestion: h.suggestion ?? (h.reason.includes("--extra-index-url") ? "Ch\u1EC9 s\u1EED d\u1EE5ng `--index-url` tr\u1ECF t\u1EDBi kho n\u1ED9i b\u1ED9 (artifact proxy) \u0111\xE3 \u0111\u01B0\u1EE3c b\u1EA3o v\u1EC7, ho\u1EB7c s\u1EED d\u1EE5ng c\u01A1 ch\u1EBF hash-pinning (`--require-hashes`)." : h.reason.includes("--trusted-host") ? "Cung c\u1EA5p ch\u1EE9ng ch\u1EC9 CA n\u1ED9i b\u1ED9 h\u1EE3p l\u1EC7 cho h\u1EC7 \u0111i\u1EC1u h\xE0nh/container thay v\xEC b\u1ECF qua ki\u1EC3m tra an to\xE0n v\u1EDBi `--trusted-host`." : "S\u1EED d\u1EE5ng HTTPS k\xE8m ch\u1EE9ng ch\u1EC9 SSL h\u1EE3p l\u1EC7 cho kho l\u01B0u tr\u1EEF g\xF3i (registry).")
29
30
  }));
30
31
  if (ctx.options.requirePinnedPackages) {
31
32
  const lines = file.content.split("\n");
@@ -9,6 +9,7 @@ var rule = {
9
9
  description: "Ph\xE1t hi\u1EC7n Dockerfile kh\xF4ng khai b\xE1o ch\u1EC9 th\u1ECB USER non-root khi\u1EBFn container ch\u1EA1y v\u1EDBi quy\u1EC1n root (UID 0) m\u1EB7c \u0111\u1ECBnh. Vi ph\u1EA1m nguy\xEAn t\u1EAFc \u0111\u1EB7c quy\u1EC1n t\u1ED1i thi\u1EC3u (CWE-250) v\xE0 t\u0103ng nguy c\u01A1 container escape.",
10
10
  severity: "error",
11
11
  category: "security",
12
+ sourceTools: ["fortify"],
12
13
  languages: ["text"],
13
14
  scope: "general",
14
15
  requires: "text",
@@ -72,6 +72,7 @@ var rule = {
72
72
  title: "Kubernetes khai b\xE1o seccomp v\xE0 gi\u1EDBi h\u1EA1n token ServiceAccount",
73
73
  severity: "warning",
74
74
  category: "security",
75
+ checklistIds: ["7"],
75
76
  languages: ["yaml"],
76
77
  scope: "general",
77
78
  usesParser: false,
@@ -42,6 +42,7 @@ var rule = {
42
42
  description: "Ph\xE1t hi\u1EC7n eval(x) v\xE0 new Function(..., x) khi x kh\xF4ng ph\u1EA3i chu\u1ED7i h\u1EB1ng (CWE-95). N\u1EBFu chu\u1ED7i l\u1EA5y t\u1EEB server, c\u1EA5u h\xECnh ho\u1EB7c ng\u01B0\u1EDDi d\xF9ng, ai ki\u1EC3m so\xE1t \u0111\u01B0\u1EE3c chu\u1ED7i \u0111\xF3 s\u1EBD ch\u1EA1y \u0111\u01B0\u1EE3c JavaScript tr\xEAn tr\xECnh duy\u1EC7t c\u1EE7a m\u1ECDi ng\u01B0\u1EDDi d\xF9ng.",
43
43
  severity: "warning",
44
44
  category: "security",
45
+ checklistIds: ["98"],
45
46
  languages: ["typescript", "javascript"],
46
47
  scope: "general",
47
48
  requires: "syntactic",
@@ -3,15 +3,17 @@ var CONFIG_FILE_RE = /\.(?:ya?ml|properties)$/i;
3
3
  var JAVA_OR_TS_RE = /\.(?:java|ts|js|mjs|cjs)$/i;
4
4
  var EMPTY_KEY_VAR_RE = /\b(?:String|byte\[\]|const|let|var)\s+([a-zA-Z0-9_]*(?:secret(?:key)?|encryptionkey|aeskey|deskey|jwtsecret|privatekey|cipherkey)[a-zA-Z0-9_]*)\s*=\s*(?:""|''|`\s*`|new\s+byte\[0\]|new\s+byte\[\]\s*\{\s*\}|\{\s*\})/i;
5
5
  var EMPTY_SECRET_KEY_SPEC_RE = /new\s+SecretKeySpec\s*\(\s*(?:""\s*\.getBytes\([^)]*\)|new\s+byte\[0\]|new\s+byte\[\]\s*\{\s*\}|\{\s*\})/i;
6
+ var EMPTY_KEY_PROPERTY_RE = /\b([a-zA-Z0-9_$]*(?:secret(?:key)?|encryptionkey|aeskey|deskey|jwtsecret|privatekey|cipherkey)[a-zA-Z0-9_$]*)\s*:\s*(?:""|''|`\s*`|\[\s*\]|\{\s*\})\s*[,;]?\s*$/i;
6
7
  var CONFIG_EMPTY_KEY_RE = /^[^\S\n]*([a-zA-Z0-9_.-]*(?:jwt[._-]secret|secret[._-]key|encryption[._-]key|aes[._-]key|cipher[._-]key|private[._-]key)[a-zA-Z0-9_.-]*)\s*[:=]\s*(?:""|''|\s*)$/i;
7
8
  var rule = {
8
9
  id: "general/no-empty-encryption-key",
9
- version: 1,
10
+ version: 2,
10
11
  kind: "static-ts",
11
12
  title: "Kh\xF4ng s\u1EED d\u1EE5ng kh\xF3a m\xE3 h\xF3a r\u1ED7ng (Empty Encryption Key / Secret)",
12
13
  description: 'Ph\xE1t hi\u1EC7n vi\u1EC7c kh\u1EDFi t\u1EA1o SecretKeySpec ho\u1EB7c g\xE1n bi\u1EBFn/c\u1EA5u h\xECnh kh\xF3a m\xE3 h\xF3a (AES, DES, JWT, Cipher) v\u1EDBi gi\xE1 tr\u1ECB r\u1ED7ng ("" ho\u1EB7c new byte[0]). Vi\u1EC7c s\u1EED d\u1EE5ng kh\xF3a r\u1ED7ng khi\u1EBFn thu\u1EADt to\xE1n m\u1EADt m\xE3 m\u1EA5t ho\xE0n to\xE0n t\xEDnh b\u1EA3o m\u1EADt, cho ph\xE9p k\u1EBB t\u1EA5n c\xF4ng d\u1EC5 d\xE0ng gi\u1EA3i m\xE3 d\u1EEF li\u1EC7u ho\u1EB7c gi\u1EA3 m\u1EA1o token (CWE-321/CWE-547).',
13
14
  severity: "error",
14
15
  category: "security",
16
+ sourceTools: ["fortify"],
15
17
  languages: ["java", "typescript", "javascript", "yaml", "text"],
16
18
  scope: "general",
17
19
  requires: "text",
@@ -53,6 +55,19 @@ var rule = {
53
55
  confidence: 90,
54
56
  suggestion: "Kh\xF4ng g\xE1n gi\xE1 tr\u1ECB r\u1ED7ng cho bi\u1EBFn kh\xF3a m\u1EADt m\xE3. N\u1EA1p kh\xF3a an to\xE0n t\u1EEB c\u1EA5u h\xECnh b\u1EA3o m\u1EADt ho\u1EB7c KeyManagementService."
55
57
  });
58
+ continue;
59
+ }
60
+ const propMatch = trimmed.match(EMPTY_KEY_PROPERTY_RE);
61
+ if (propMatch) {
62
+ const propName = propMatch[1];
63
+ findings.push({
64
+ message: `Thu\u1ED9c t\xEDnh kh\xF3a m\xE3 h\xF3a \`${propName}\` mang gi\xE1 tr\u1ECB r\u1ED7ng \u2014 n\u1EBFu gi\xE1 tr\u1ECB n\xE0y \u0111\u01B0\u1EE3c d\xF9ng l\xE0m kh\xF3a th\u1EADt th\xEC m\u1ECDi d\u1EEF li\u1EC7u m\xE3 h\xF3a b\u1EB1ng n\xF3 \u0111\u1EC1u b\u1ECB gi\u1EA3i m\xE3 \u0111\u01B0\u1EE3c (CWE-321/CWE-547).`,
65
+ file: file.path,
66
+ range: { line: i + 1, column: 1 },
67
+ severity: "warning",
68
+ confidence: 75,
69
+ suggestion: `\u0110\u1EA3m b\u1EA3o \`${propName}\` lu\xF4n \u0111\u01B0\u1EE3c n\u1EA1p t\u1EEB ngu\u1ED3n b\xED m\u1EADt th\u1EADt (bi\u1EBFn m\xF4i tr\u01B0\u1EDDng/Vault/KeyManagementService) tr\u01B0\u1EDBc khi d\xF9ng; kh\xF4ng \u0111\u1EC3 gi\xE1 tr\u1ECB r\u1ED7ng \u0111i t\u1EDBi Cipher/HashMac.`
70
+ });
56
71
  }
57
72
  }
58
73
  if (isConfig) {