@code-sentinel-cli/code-sentinel-cli 3.0.3 → 3.0.5

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 (133) hide show
  1. package/README.md +1 -1
  2. package/dist/bin.js +1191 -816
  3. package/dist/builtin-rules/ai/angular/api-service-contract-risk.prompt.md +71 -0
  4. package/dist/builtin-rules/ai/angular/api-service-contract-risk.rule.yaml +22 -0
  5. package/dist/builtin-rules/ai/angular/component-state-flow.prompt.md +79 -0
  6. package/dist/builtin-rules/ai/angular/component-state-flow.rule.yaml +26 -0
  7. package/dist/builtin-rules/ai/angular/cross-feature-api-drift.prompt.md +70 -0
  8. package/dist/builtin-rules/ai/angular/cross-feature-api-drift.rule.yaml +42 -0
  9. package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.prompt.md +73 -0
  10. package/dist/builtin-rules/ai/angular/cross-feature-route-permission-drift.rule.yaml +50 -0
  11. package/dist/builtin-rules/ai/angular/reactive-form-flow.prompt.md +82 -0
  12. package/dist/builtin-rules/ai/angular/reactive-form-flow.rule.yaml +23 -0
  13. package/dist/builtin-rules/ai/angular/route-permission-flow.prompt.md +80 -0
  14. package/dist/builtin-rules/ai/angular/route-permission-flow.rule.yaml +23 -0
  15. package/dist/builtin-rules/ai/angular/rxjs-flow-risk.prompt.md +82 -0
  16. package/dist/builtin-rules/ai/angular/rxjs-flow-risk.rule.yaml +24 -0
  17. package/dist/builtin-rules/ai/angular/template-contract-risk.prompt.md +80 -0
  18. package/dist/builtin-rules/ai/angular/template-contract-risk.rule.yaml +25 -0
  19. package/dist/builtin-rules/ai/flutter/dynamic-content-risk.prompt.md +55 -0
  20. package/dist/builtin-rules/ai/flutter/dynamic-content-risk.rule.yaml +18 -0
  21. package/dist/builtin-rules/ai/flutter/feature-state-flow-risk.prompt.md +58 -0
  22. package/dist/builtin-rules/ai/flutter/feature-state-flow-risk.rule.yaml +18 -0
  23. package/dist/builtin-rules/ai/flutter/native-platform-consistency-risk.prompt.md +56 -0
  24. package/dist/builtin-rules/ai/flutter/native-platform-consistency-risk.rule.yaml +18 -0
  25. package/dist/builtin-rules/ai/flutter/network-auth-flow-risk.prompt.md +57 -0
  26. package/dist/builtin-rules/ai/flutter/network-auth-flow-risk.rule.yaml +19 -0
  27. package/dist/builtin-rules/ai/flutter/ui-responsive-accessibility-risk.prompt.md +60 -0
  28. package/dist/builtin-rules/ai/flutter/ui-responsive-accessibility-risk.rule.yaml +18 -0
  29. package/dist/builtin-rules/ai/general/code-clarity.prompt.md +57 -0
  30. package/dist/builtin-rules/ai/general/code-clarity.rule.yaml +20 -0
  31. package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.prompt.md +86 -0
  32. package/dist/builtin-rules/ai/spring-boot/business-invariant-risk.rule.yaml +25 -0
  33. package/dist/builtin-rules/ai/spring-boot/cache-consistency-risk.prompt.md +80 -0
  34. package/dist/builtin-rules/ai/spring-boot/cache-consistency-risk.rule.yaml +25 -0
  35. package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.prompt.md +76 -0
  36. package/dist/builtin-rules/ai/spring-boot/cross-feature-error-handling-drift.rule.yaml +63 -0
  37. package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.prompt.md +85 -0
  38. package/dist/builtin-rules/ai/spring-boot/cross-feature-transaction-boundary-drift.rule.yaml +68 -0
  39. package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.prompt.md +121 -0
  40. package/dist/builtin-rules/ai/spring-boot/error-handling-completeness.rule.yaml +84 -0
  41. package/dist/builtin-rules/ai/spring-boot/event-publishing-risk.prompt.md +80 -0
  42. package/dist/builtin-rules/ai/spring-boot/event-publishing-risk.rule.yaml +25 -0
  43. package/dist/builtin-rules/ai/spring-boot/io-boundary-risk.prompt.md +78 -0
  44. package/dist/builtin-rules/ai/spring-boot/io-boundary-risk.rule.yaml +25 -0
  45. package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.prompt.md +83 -0
  46. package/dist/builtin-rules/ai/spring-boot/ownership-scope-risk.rule.yaml +25 -0
  47. package/dist/builtin-rules/ai/spring-boot/pagination-risk.prompt.md +81 -0
  48. package/dist/builtin-rules/ai/spring-boot/pagination-risk.rule.yaml +25 -0
  49. package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.prompt.md +75 -0
  50. package/dist/builtin-rules/ai/spring-boot/security-authorization-risk.rule.yaml +26 -0
  51. package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.prompt.md +75 -0
  52. package/dist/builtin-rules/ai/spring-boot/security-mass-assignment-risk.rule.yaml +24 -0
  53. package/dist/builtin-rules/ai/spring-boot/security-redirect-risk.prompt.md +74 -0
  54. package/dist/builtin-rules/ai/spring-boot/security-redirect-risk.rule.yaml +24 -0
  55. package/dist/builtin-rules/ai/spring-boot/security-sensitive-data-risk.prompt.md +75 -0
  56. package/dist/builtin-rules/ai/spring-boot/security-sensitive-data-risk.rule.yaml +25 -0
  57. package/dist/builtin-rules/ai/spring-boot/transaction-loop-risk.prompt.md +78 -0
  58. package/dist/builtin-rules/ai/spring-boot/transaction-loop-risk.rule.yaml +25 -0
  59. package/dist/builtin-rules/static/angular/component-prefix.rule.js +78 -0
  60. package/dist/builtin-rules/static/angular/image-control-alt-required.rule.js +105 -0
  61. package/dist/builtin-rules/static/angular/img-alt-required.rule.js +96 -0
  62. package/dist/builtin-rules/static/angular/inject-pattern.rule.js +47 -0
  63. package/dist/builtin-rules/static/angular/lifecycle-method-required.rule.js +59 -0
  64. package/dist/builtin-rules/static/angular/no-any-type.rule.yaml +55 -0
  65. package/dist/builtin-rules/static/angular/no-direct-dom-access.rule.js +191 -0
  66. package/dist/builtin-rules/static/angular/no-dom-xss.rule.js +48 -0
  67. package/dist/builtin-rules/static/angular/no-leaky-subscription.rule.js +197 -0
  68. package/dist/builtin-rules/static/angular/no-ngmodule.rule.yaml +44 -0
  69. package/dist/builtin-rules/static/angular/no-non-null-asserted-optional-chain.rule.js +53 -0
  70. package/dist/builtin-rules/static/angular/no-uncalled-signal-in-condition.rule.js +112 -0
  71. package/dist/builtin-rules/static/angular/observable-naming.rule.js +85 -0
  72. package/dist/builtin-rules/static/angular/onpush-required.rule.js +70 -0
  73. package/dist/builtin-rules/static/angular/standalone-component-required.rule.js +65 -0
  74. package/dist/builtin-rules/static/angular/template-dom-xss.rule.js +112 -0
  75. package/dist/builtin-rules/static/angular/template-syntax-modern.rule.js +154 -0
  76. package/dist/builtin-rules/static/angular/trackby-required.rule.js +66 -0
  77. package/dist/builtin-rules/static/flutter/android-exported-component.rule.js +75 -0
  78. package/dist/builtin-rules/static/flutter/android-manifest-hardening.rule.js +117 -0
  79. package/dist/builtin-rules/static/flutter/android-sensitive-permissions.rule.js +87 -0
  80. package/dist/builtin-rules/static/flutter/debug-tooling-release-risk.rule.js +90 -0
  81. package/dist/builtin-rules/static/flutter/dynamic-archive-risk.rule.js +96 -0
  82. package/dist/builtin-rules/static/flutter/hive-sensitive-storage.rule.js +77 -0
  83. package/dist/builtin-rules/static/flutter/ios-privacy-hardening.rule.js +119 -0
  84. package/dist/builtin-rules/static/flutter/packaged-env-risk.rule.js +95 -0
  85. package/dist/builtin-rules/static/flutter/sensitive-log-leak.rule.js +94 -0
  86. package/dist/builtin-rules/static/flutter/webview-bridge-guard.rule.js +102 -0
  87. package/dist/builtin-rules/static/general/file-too-long.rule.js +41 -0
  88. package/dist/builtin-rules/static/general/function-too-long.rule.js +72 -0
  89. package/dist/builtin-rules/static/general/no-circular-import.rule.js +39 -0
  90. package/dist/builtin-rules/static/general/no-code-injection.rule.js +48 -0
  91. package/dist/builtin-rules/static/general/no-console-log.rule.js +110 -0
  92. package/dist/builtin-rules/static/general/no-empty-catch.rule.yaml +56 -0
  93. package/dist/builtin-rules/static/general/no-hardcoded-secret.rule.js +517 -0
  94. package/dist/builtin-rules/static/general/no-magic-number.rule.js +78 -0
  95. package/dist/builtin-rules/static/general/no-open-redirect.rule.js +46 -0
  96. package/dist/builtin-rules/static/general/no-todo-comment.rule.yaml +30 -0
  97. package/dist/builtin-rules/static/general/no-unresolved-import-symbol.rule.js +80 -0
  98. package/dist/builtin-rules/static/general/no-unused-export.rule.js +140 -0
  99. package/dist/builtin-rules/static/spring-boot/no-autowired-field.rule.js +162 -0
  100. package/dist/builtin-rules/static/spring-boot/no-business-logic-in-controller.rule.js +94 -0
  101. package/dist/builtin-rules/static/spring-boot/no-command-injection.rule.js +47 -0
  102. package/dist/builtin-rules/static/spring-boot/no-entity-in-controller.rule.yaml +52 -0
  103. package/dist/builtin-rules/static/spring-boot/no-nplus1-query-in-loop.rule.js +106 -0
  104. package/dist/builtin-rules/static/spring-boot/no-path-traversal.rule.js +47 -0
  105. package/dist/builtin-rules/static/spring-boot/no-spel-injection.rule.js +41 -0
  106. package/dist/builtin-rules/static/spring-boot/no-sql-string-concat.rule.js +194 -0
  107. package/dist/builtin-rules/static/spring-boot/no-ssrf.rule.js +49 -0
  108. package/dist/builtin-rules/static/spring-boot/no-transactional-self-invocation.rule.js +142 -0
  109. package/dist/builtin-rules/static/spring-boot/no-unclosed-resource.rule.js +108 -0
  110. package/dist/builtin-rules/static/spring-boot/no-unsafe-shared-formatter.rule.js +118 -0
  111. package/dist/builtin-rules/static/spring-boot/repository-naming.rule.yaml +42 -0
  112. package/dist/builtin-rules/static/spring-boot/restful-naming.rule.yaml +39 -0
  113. package/dist/builtin-rules/static/spring-boot/transaction-on-service.rule.yaml +58 -0
  114. package/dist/builtin-rules/static/spring-boot/validate-input.rule.js +123 -0
  115. package/dist/builtin-rules/vauthz/static/spring-boot/require-authz-check.rule.js +101 -0
  116. package/dist/index.d.ts +225 -48
  117. package/dist/index.js +1190 -815
  118. package/node_modules/@code-sentinel/core/index.js +55 -0
  119. package/node_modules/@code-sentinel/core/package.json +6 -0
  120. package/node_modules/@code-sentinel/parsers/index.js +13 -0
  121. package/node_modules/@code-sentinel/parsers/package.json +6 -0
  122. package/package.json +34 -29
  123. package/src/migrations/0000_initial.sql +62 -0
  124. package/src/migrations/0001_add_confidence.sql +7 -0
  125. package/src/migrations/0002_add_ai_stats.sql +21 -0
  126. package/src/migrations/0003_add_fix_recipe.sql +29 -0
  127. package/src/migrations/0004_add_ast_graph.sql +61 -0
  128. package/src/migrations/0005_add_project_id.sql +1 -0
  129. package/src/migrations/0006_add_ai_model.sql +5 -0
  130. package/src/migrations/0006_add_rule_results.sql +1 -0
  131. package/src/migrations/0007_add_finding_metadata.sql +4 -0
  132. package/src/migrations/0008_add_coverage.sql +2 -0
  133. package/src/migrations/0009_run_provenance.sql +5 -0
@@ -0,0 +1,112 @@
1
+ import { asTreeSitterTree } from '@code-sentinel/parsers';
2
+
3
+ // builtin-rules/static/angular/template-dom-xss.rule.ts
4
+ var HTML_SINK_PROPS = /* @__PURE__ */ new Set(["innerhtml", "outerhtml"]);
5
+ var URL_SINK_TAGS = {
6
+ src: /* @__PURE__ */ new Set(["iframe", "script", "embed"]),
7
+ srcdoc: /* @__PURE__ */ new Set(["iframe"]),
8
+ data: /* @__PURE__ */ new Set(["object"])
9
+ };
10
+ var SANITIZER_PIPE = /\|\s*(safe\w*|sanitize\w*|dompurify\w*)/i;
11
+ var PURE_STRING_LITERAL = /^\s*'[^']*'\s*$|^\s*"[^"]*"\s*$/;
12
+ function* walk(node, type) {
13
+ const stack = [node];
14
+ while (stack.length > 0) {
15
+ const cur = stack.pop();
16
+ if (!cur) continue;
17
+ if (cur.type === type) yield cur;
18
+ for (let i = cur.namedChildCount - 1; i >= 0; i--) {
19
+ const child = cur.namedChild(i);
20
+ if (child) stack.push(child);
21
+ }
22
+ }
23
+ }
24
+ function namedChildOfType(node, type) {
25
+ for (let i = 0; i < node.namedChildCount; i++) {
26
+ const child = node.namedChild(i);
27
+ if (child?.type === type) return child;
28
+ }
29
+ return null;
30
+ }
31
+ function attributeValue(attr) {
32
+ const quoted = namedChildOfType(attr, "quoted_attribute_value");
33
+ const value = quoted ? namedChildOfType(quoted, "attribute_value") : null;
34
+ return value?.text ?? "";
35
+ }
36
+ function enclosingTag(attr) {
37
+ const tag = attr.parent ? namedChildOfType(attr.parent, "tag_name") : null;
38
+ return tag ? tag.text.toLowerCase() : null;
39
+ }
40
+ function normalizeBinding(name) {
41
+ const bracket = /^\[(.+)\]$/.exec(name);
42
+ let inner = bracket?.[1];
43
+ let isBinding = bracket !== null;
44
+ if (!isBinding && name.startsWith("bind-")) {
45
+ inner = name.slice("bind-".length);
46
+ isBinding = true;
47
+ }
48
+ const prop = (inner ?? name).replace(/^attr\./i, "").toLowerCase();
49
+ return { prop, isBinding };
50
+ }
51
+ function rootIdentifier(expr) {
52
+ const m = /[A-Za-z_$][\w$]*/.exec(expr);
53
+ return m ? m[0] : null;
54
+ }
55
+ var rule = {
56
+ id: "angular/template-dom-xss",
57
+ version: 2,
58
+ kind: "static-ts",
59
+ usesTemplateComponent: true,
60
+ title: "Binding nguy hi\u1EC3m trong template Angular (DOM XSS)",
61
+ description: "Binding `[innerHTML]` / `[outerHTML]` (ho\u1EB7c `[src]`/`[srcdoc]`/`[data]` tr\xEAn `<iframe>`/`<script>`/`<embed>`/`<object>`) g\u1EAFn v\xE0o m\u1ED9t bi\u1EC3u th\u1EE9c \u0111\u1ED9ng trong template `.html` l\xE0 \u0111i\u1EC3m v\xE0o DOM XSS m\xE0 rule `angular/no-dom-xss` (ch\u1EC9 qu\xE9t `.ts`) kh\xF4ng th\u1EA5y \u0111\u01B0\u1EE3c. v2 truy ng\u01B0\u1EE3c bi\u1EC3u th\u1EE9c v\u1EC1 member c\u1EE7a component (`templateUrl`): n\u1EBFu member \u0111\u01B0\u1EE3c g\xE1n t\u1EEB `DomSanitizer.sanitize`/`bypassSecurityTrust*` \u2192 b\u1ECF qua (\u0111\xE3 tin c\u1EADy); n\u1EBFu g\xE1n t\u1EEB ngu\u1ED3n input (`ActivatedRoute`/`location`/`document`/`window`) ch\u01B0a sanitize \u2192 b\xE1o `error` (\u0111\xE3 x\xE1c nh\u1EADn lu\u1ED3ng); c\xF2n l\u1EA1i \u2192 c\u1EA3nh b\xE1o c\u1EA5u tr\xFAc. Kh\u1EAFc ph\u1EE5c: bind qua gi\xE1 tr\u1ECB \u0111\xE3 `DomSanitizer.sanitize(...)` / pipe `| safeHtml`, ho\u1EB7c d\xF9ng text-binding `{{ }}` (Angular t\u1EF1 escape) thay v\xEC `[innerHTML]`.",
62
+ severity: "warning",
63
+ category: "security",
64
+ languages: ["html"],
65
+ scope: "angular",
66
+ requires: "syntactic",
67
+ baseConfidence: 70,
68
+ check(ctx) {
69
+ const tree = asTreeSitterTree(ctx.parsed);
70
+ const findings = [];
71
+ const link = ctx.templateComponent ?? null;
72
+ for (const attr of walk(tree.rootNode, "attribute")) {
73
+ const nameNode = namedChildOfType(attr, "attribute_name");
74
+ if (!nameNode) continue;
75
+ const { prop, isBinding } = normalizeBinding(nameNode.text);
76
+ if (!isBinding) continue;
77
+ const isHtmlSink = HTML_SINK_PROPS.has(prop);
78
+ const tag = isHtmlSink ? null : enclosingTag(attr);
79
+ const isUrlSink = !isHtmlSink && tag !== null && (URL_SINK_TAGS[prop]?.has(tag) ?? false);
80
+ if (!isHtmlSink && !isUrlSink) continue;
81
+ const value = attributeValue(attr);
82
+ if (PURE_STRING_LITERAL.test(value)) continue;
83
+ if (SANITIZER_PIPE.test(value)) continue;
84
+ let origin = "unknown";
85
+ if (link) {
86
+ const root = rootIdentifier(value);
87
+ if (root) origin = link.memberOrigins.get(root) ?? "unknown";
88
+ }
89
+ if (origin === "sanitizer-trusted") continue;
90
+ const confirmed = origin === "tainted-source";
91
+ const where = isHtmlSink ? `\`${nameNode.text}\` ch\xE8n HTML ch\u01B0a ki\u1EC3m so\xE1t v\xE0o DOM` : `\`${nameNode.text}\` tr\xEAn \`<${tag}>\` n\u1EA1p t\xE0i nguy\xEAn/URL c\xF3 th\u1EC3 ch\u1EE9a m\xE3`;
92
+ findings.push({
93
+ message: confirmed ? `\u26D4 XSS qua template (\u0110\xC3 X\xC1C NH\u1EACN): ${where} \u2014 bi\u1EC3u th\u1EE9c \`${value}\` l\u1EA5y t\u1EEB input ng\u01B0\u1EDDi d\xF9ng trong component \`${link?.componentPath}\` m\xE0 ch\u01B0a sanitize.` : `\u26A0 C\xF3 th\u1EC3 XSS qua template: ${where} (bi\u1EC3u th\u1EE9c \`${value}\`) \u2014 h\xE3y ch\u1EAFc ch\u1EAFn gi\xE1 tr\u1ECB \u0111\xE3 \u0111\u01B0\u1EE3c sanitize.`,
94
+ file: ctx.file.path,
95
+ range: {
96
+ line: attr.startPosition.row + 1,
97
+ column: attr.startPosition.column + 1
98
+ },
99
+ // Promote a CONFIRMED source→sink flow to `error`/85 (consistent with
100
+ // how `angular/no-dom-xss` reports confirmed flows on the `.ts` side);
101
+ // unresolved/unknown stays the structural `warning` @ baseConfidence 70.
102
+ ...confirmed ? { severity: "error", confidence: 85 } : {},
103
+ suggestion: isHtmlSink ? "Sanitize tr\u01B0\u1EDBc khi bind (`DomSanitizer.sanitize(SecurityContext.HTML, x)` ho\u1EB7c pipe `| safeHtml`), ho\u1EB7c d\xF9ng text-binding `{{ }}` \u0111\u1EC3 Angular t\u1EF1 escape." : "Validate URL b\u1EB1ng allowlist host/scheme c\u1ED1 \u0111\u1ECBnh tr\u01B0\u1EDBc khi bind; tr\xE1nh n\u1EA1p `<iframe>`/`<script>` t\u1EEB gi\xE1 tr\u1ECB ng\u01B0\u1EDDi d\xF9ng nh\u1EADp."
104
+ });
105
+ }
106
+ return findings;
107
+ }
108
+ };
109
+
110
+ export { rule };
111
+ //# sourceMappingURL=template-dom-xss.rule.js.map
112
+ //# sourceMappingURL=template-dom-xss.rule.js.map
@@ -0,0 +1,154 @@
1
+ import { asTsMorphSourceFile } from '@code-sentinel/parsers';
2
+ import { Node } from 'ts-morph';
3
+
4
+ // builtin-rules/static/angular/template-syntax-modern.rule.ts
5
+ var LEGACY_PATTERNS = [
6
+ { regex: /\*ngIf\b/g, legacy: "*ngIf", modern: "@if", fixKind: "ng-if" },
7
+ { regex: /\*ngFor\b/g, legacy: "*ngFor", modern: "@for", fixKind: "ng-for" },
8
+ { regex: /\*ngSwitch\b/g, legacy: "*ngSwitch", modern: "@switch" },
9
+ { regex: /\*ngSwitchCase\b/g, legacy: "*ngSwitchCase", modern: "@case" },
10
+ { regex: /\*ngSwitchDefault\b/g, legacy: "*ngSwitchDefault", modern: "@default" }
11
+ ];
12
+ var getComponentDecorator = (cls) => {
13
+ for (const d of cls.getDecorators()) {
14
+ if (d.getName() === "Component") return d;
15
+ }
16
+ return void 0;
17
+ };
18
+ var getDecoratorObject = (decorator) => {
19
+ const call = decorator.getCallExpression();
20
+ if (!call) return void 0;
21
+ const [arg] = call.getArguments();
22
+ if (!arg || !Node.isObjectLiteralExpression(arg)) return void 0;
23
+ return arg;
24
+ };
25
+ var getTemplateInfo = (obj) => {
26
+ for (const prop of obj.getProperties()) {
27
+ if (!Node.isPropertyAssignment(prop)) continue;
28
+ if (prop.getName() !== "template") continue;
29
+ const init = prop.getInitializer();
30
+ if (!init) return void 0;
31
+ if (Node.isStringLiteral(init) || Node.isNoSubstitutionTemplateLiteral(init)) {
32
+ return { text: init.getLiteralText(), contentStart: init.getStart() + 1 };
33
+ }
34
+ }
35
+ return void 0;
36
+ };
37
+ var parseSimpleElementLine = (lineText) => {
38
+ const match = /^(\s*)<([A-Za-z][\w:-]*)([^>]*)>(.*?)<\/\2>(\s*)$/.exec(lineText);
39
+ if (!match) return void 0;
40
+ return {
41
+ indent: match[1] ?? "",
42
+ tag: match[2] ?? "",
43
+ attrs: match[3] ?? "",
44
+ body: match[4] ?? "",
45
+ suffix: match[5] ?? ""
46
+ };
47
+ };
48
+ var replaceAttribute = (attrs, attrName) => {
49
+ const attr = new RegExp(`\\s\\${attrName}=(["'])(.*?)\\1`).exec(attrs);
50
+ const full = attr?.[0];
51
+ const value = attr?.[2];
52
+ if (!full || value === void 0) return void 0;
53
+ return {
54
+ updatedAttrs: attrs.replace(full, ""),
55
+ value
56
+ };
57
+ };
58
+ var buildReplacement = (lineText, fixKind) => {
59
+ const element = parseSimpleElementLine(lineText);
60
+ if (!element) return void 0;
61
+ if (fixKind === "ng-if") {
62
+ const attr2 = replaceAttribute(element.attrs, "*ngIf");
63
+ if (!attr2) return void 0;
64
+ return `${element.indent}@if (${attr2.value}) { <${element.tag}${attr2.updatedAttrs}>${element.body}</${element.tag}> }${element.suffix}`;
65
+ }
66
+ const attr = replaceAttribute(element.attrs, "*ngFor");
67
+ if (!attr) return void 0;
68
+ const forExpr = /^\s*let\s+([A-Za-z_$][\w$]*)\s+of\s+([^;]+?)\s*$/.exec(attr.value);
69
+ const itemName = forExpr?.[1];
70
+ const collectionExpr = forExpr?.[2];
71
+ if (!itemName || !collectionExpr) return void 0;
72
+ return `${element.indent}@for (${itemName} of ${collectionExpr}; track ${itemName}) { <${element.tag}${attr.updatedAttrs}>${element.body}</${element.tag}> }${element.suffix}`;
73
+ };
74
+ var buildSimpleLineFix = (args) => {
75
+ const lineStart = args.template.text.lastIndexOf("\n", args.matchIndex - 1) + 1;
76
+ const nextNewline = args.template.text.indexOf("\n", args.matchIndex);
77
+ const lineEnd = nextNewline === -1 ? args.template.text.length : nextNewline;
78
+ const lineText = args.template.text.slice(lineStart, lineEnd);
79
+ const replacement = buildReplacement(lineText, args.fixKind);
80
+ if (replacement === void 0) return void 0;
81
+ const startOffset = args.template.contentStart + lineStart;
82
+ const endOffset = args.template.contentStart + lineEnd;
83
+ const start = args.sourceFile.getLineAndColumnAtPos(startOffset);
84
+ const end = args.sourceFile.getLineAndColumnAtPos(endOffset);
85
+ return {
86
+ safety: "safe",
87
+ description: "Convert simple inline structural directive to Angular control-flow syntax",
88
+ edits: [
89
+ {
90
+ file: args.filePath,
91
+ startLine: start.line,
92
+ startColumn: start.column,
93
+ endLine: end.line,
94
+ endColumn: end.column,
95
+ newText: replacement
96
+ }
97
+ ]
98
+ };
99
+ };
100
+ var rule = {
101
+ id: "angular/template-syntax-modern",
102
+ version: 2,
103
+ kind: "static-ts",
104
+ title: "D\xF9ng @if/@for/@switch thay cho *ngIf/*ngFor/*ngSwitch* (Angular 17+)",
105
+ description: 'Angular 17+ control-flow syntax (`@if`, `@for`, `@switch`) faster, terser, d\u1EC5 debug h\u01A1n structural directives c\u0169. Rule n\xE0y qu\xE9t inline template (`template: "..."`). External template file (`templateUrl`) s\u1EBD support \u1EDF phase sau.',
106
+ severity: "info",
107
+ category: "angular-best-practice",
108
+ languages: ["typescript"],
109
+ scope: "angular",
110
+ requires: "semantic-ts",
111
+ baseConfidence: 95,
112
+ check(ctx) {
113
+ const sf = asTsMorphSourceFile(ctx.parsed);
114
+ const findings = [];
115
+ for (const cls of sf.getClasses()) {
116
+ const decorator = getComponentDecorator(cls);
117
+ if (!decorator) continue;
118
+ const obj = getDecoratorObject(decorator);
119
+ if (!obj) continue;
120
+ const template = getTemplateInfo(obj);
121
+ if (!template) continue;
122
+ for (const { regex, legacy, modern, fixKind } of LEGACY_PATTERNS) {
123
+ const re = new RegExp(regex.source, regex.flags);
124
+ let m;
125
+ m = re.exec(template.text);
126
+ while (m !== null) {
127
+ const fileOffset = template.contentStart + m.index;
128
+ const { line, column } = sf.getLineAndColumnAtPos(fileOffset);
129
+ findings.push({
130
+ message: `Inline template d\xF9ng \`${legacy}\` \u2014 Angular 17+ \u01B0u ti\xEAn \`${modern}\`.`,
131
+ file: ctx.file.path,
132
+ range: { line, column },
133
+ suggestion: `Refactor sang \`${modern}\` control-flow syntax.`,
134
+ ...fixKind ? {
135
+ fix: buildSimpleLineFix({
136
+ template,
137
+ matchIndex: m.index,
138
+ fixKind,
139
+ filePath: ctx.file.path,
140
+ sourceFile: sf
141
+ })
142
+ } : {}
143
+ });
144
+ m = re.exec(template.text);
145
+ }
146
+ }
147
+ }
148
+ return findings;
149
+ }
150
+ };
151
+
152
+ export { rule };
153
+ //# sourceMappingURL=template-syntax-modern.rule.js.map
154
+ //# sourceMappingURL=template-syntax-modern.rule.js.map
@@ -0,0 +1,66 @@
1
+ import { asTreeSitterTree } from '@code-sentinel/parsers';
2
+
3
+ // builtin-rules/static/angular/trackby-required.rule.ts
4
+ var NGFOR_ATTR = "*ngFor";
5
+ var HAS_TRACKBY = /\btrackBy\s*:/;
6
+ function* walk(node, type) {
7
+ const stack = [node];
8
+ while (stack.length > 0) {
9
+ const cur = stack.pop();
10
+ if (!cur) continue;
11
+ if (cur.type === type) yield cur;
12
+ for (let i = cur.namedChildCount - 1; i >= 0; i--) {
13
+ const child = cur.namedChild(i);
14
+ if (child) stack.push(child);
15
+ }
16
+ }
17
+ }
18
+ function namedChildOfType(node, type) {
19
+ for (let i = 0; i < node.namedChildCount; i++) {
20
+ const child = node.namedChild(i);
21
+ if (child?.type === type) return child;
22
+ }
23
+ return null;
24
+ }
25
+ function attributeValue(attr) {
26
+ const quoted = namedChildOfType(attr, "quoted_attribute_value");
27
+ const value = quoted ? namedChildOfType(quoted, "attribute_value") : null;
28
+ return value?.text ?? "";
29
+ }
30
+ var rule = {
31
+ id: "angular/trackby-required",
32
+ version: 1,
33
+ kind: "static-ts",
34
+ title: "`*ngFor` n\xEAn khai b\xE1o `trackBy` \u0111\u1EC3 tr\xE1nh re-render to\xE0n b\u1ED9 list",
35
+ description: "V\xF2ng l\u1EB7p `*ngFor` kh\xF4ng c\xF3 `trackBy` khi\u1EBFn Angular d\u1EF1ng l\u1EA1i to\xE0n b\u1ED9 DOM c\u1EE7a list m\u1ED7i khi array \u0111\u1ED5i tham chi\u1EBFu (r\u1EA5t ph\u1ED5 bi\u1EBFn v\u1EDBi `| async`, immutable state, refetch HTTP) thay v\xEC gi\u1EEF l\u1EA1i node c\u0169 \u2014 m\u1ED9t trong c\xE1c v\u1EA5n \u0111\u1EC1 perf th\u01B0\u1EDDng g\u1EB7p nh\u1EA5t. Th\xEAm `; trackBy: trackFn` (tr\u1EA3 v\u1EC1 id \u1ED5n \u0111\u1ECBnh c\u1EE7a item), ho\u1EB7c chuy\u1EC3n sang control-flow `@for (x of items; track x.id)` c\u1EE7a Angular 17+.",
36
+ severity: "warning",
37
+ category: "performance",
38
+ languages: ["html"],
39
+ scope: "angular",
40
+ requires: "syntactic",
41
+ baseConfidence: 70,
42
+ check(ctx) {
43
+ const tree = asTreeSitterTree(ctx.parsed);
44
+ const findings = [];
45
+ for (const attr of walk(tree.rootNode, "attribute")) {
46
+ const nameNode = namedChildOfType(attr, "attribute_name");
47
+ if (!nameNode || nameNode.text !== NGFOR_ATTR) continue;
48
+ const value = attributeValue(attr);
49
+ if (HAS_TRACKBY.test(value)) continue;
50
+ findings.push({
51
+ message: "`*ngFor` thi\u1EBFu `trackBy` \u2014 Angular s\u1EBD re-render to\xE0n b\u1ED9 list khi array \u0111\u1ED5i tham chi\u1EBFu. Th\xEAm `trackBy` tr\u1EA3 v\u1EC1 id \u1ED5n \u0111\u1ECBnh c\u1EE7a item.",
52
+ file: ctx.file.path,
53
+ range: {
54
+ line: attr.startPosition.row + 1,
55
+ column: attr.startPosition.column + 1
56
+ },
57
+ suggestion: "Th\xEAm `; trackBy: trackFn` v\xE0o `*ngFor` (trackFn tr\u1EA3 v\u1EC1 id \u1ED5n \u0111\u1ECBnh, vd `(_, item) => item.id`), ho\u1EB7c d\xF9ng `@for (x of items; track x.id)` (Angular 17+)."
58
+ });
59
+ }
60
+ return findings;
61
+ }
62
+ };
63
+
64
+ export { rule };
65
+ //# sourceMappingURL=trackby-required.rule.js.map
66
+ //# sourceMappingURL=trackby-required.rule.js.map
@@ -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
+ var attrValue = (xml, attr) => {
24
+ const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
25
+ return new RegExp(`${escaped}\\s*=\\s*["']([^"']+)["']`).exec(xml)?.[1] ?? null;
26
+ };
27
+ var isPath = (file, suffix) => file.path.replace(/\\/g, "/").toLowerCase().endsWith(suffix.toLowerCase());
28
+
29
+ // builtin-rules/static/flutter/android-exported-component.rule.ts
30
+ var COMPONENT_OPEN_RE = /<(activity-alias|activity|service|receiver|provider)\b[^>]*(?:\/>|>)/gi;
31
+ var isLauncherActivity = (kind, block) => (kind === "activity" || kind === "activity-alias") && /android\.intent\.action\.MAIN/.test(block) && /android\.intent\.category\.LAUNCHER/.test(block);
32
+ var rule = {
33
+ id: "flutter/android-exported-component",
34
+ version: 1,
35
+ kind: "static-ts",
36
+ title: "Exported Android component ph\u1EA3i c\xF3 guard",
37
+ description: "Flag activity/service/receiver/provider exported=true kh\xF4ng c\xF3 permission, b\u1ECF qua launcher activity h\u1EE3p l\u1EC7.",
38
+ severity: "warning",
39
+ category: "mobile-security",
40
+ languages: ["xml"],
41
+ scope: "flutter",
42
+ requires: "text",
43
+ baseConfidence: 84,
44
+ check(ctx) {
45
+ if (!isPath(ctx.file, "androidmanifest.xml")) return [];
46
+ const out = [];
47
+ for (const match of ctx.file.content.matchAll(COMPONENT_OPEN_RE)) {
48
+ const kind = match[1] ?? "component";
49
+ const startIndex = match.index ?? 0;
50
+ const startTag = match[0];
51
+ const block = startTag.endsWith("/>") || kind === "provider" ? startTag : (() => {
52
+ const close = `</${kind}>`;
53
+ const closeIndex = ctx.file.content.indexOf(close, startIndex + startTag.length);
54
+ return closeIndex >= 0 ? ctx.file.content.slice(startIndex, closeIndex + close.length) : startTag;
55
+ })();
56
+ if (attrValue(block, "android:exported") !== "true") continue;
57
+ if (isLauncherActivity(kind, block)) continue;
58
+ if (attrValue(block, "android:permission")) continue;
59
+ const name = attrValue(block, "android:name") ?? kind;
60
+ out.push(
61
+ finding(
62
+ ctx.file,
63
+ startIndex,
64
+ `Android ${kind} exported=true nh\u01B0ng ch\u01B0a th\u1EA5y permission guard (${name}).`,
65
+ 'Th\xEAm `android:permission`, gi\u1EDBi h\u1EA1n intent-filter, ho\u1EB7c \u0111\u1EB7t `android:exported="false"` n\u1EBFu kh\xF4ng c\u1EA7n m\u1EDF ra ngo\xE0i app.'
66
+ )
67
+ );
68
+ }
69
+ return out;
70
+ }
71
+ };
72
+
73
+ export { rule };
74
+ //# sourceMappingURL=android-exported-component.rule.js.map
75
+ //# sourceMappingURL=android-exported-component.rule.js.map
@@ -0,0 +1,117 @@
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
+ var firstIndex = (content, pattern) => {
24
+ if (typeof pattern === "string") return content.indexOf(pattern);
25
+ const match = pattern.exec(content);
26
+ return match?.index ?? -1;
27
+ };
28
+ var attrValue = (xml, attr) => {
29
+ const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
30
+ return new RegExp(`${escaped}\\s*=\\s*["']([^"']+)["']`).exec(xml)?.[1] ?? null;
31
+ };
32
+ var isPath = (file, suffix) => file.path.replace(/\\/g, "/").toLowerCase().endsWith(suffix.toLowerCase());
33
+
34
+ // builtin-rules/static/flutter/android-manifest-hardening.rule.ts
35
+ var rule = {
36
+ id: "flutter/android-manifest-hardening",
37
+ version: 1,
38
+ kind: "static-ts",
39
+ title: "Android manifest hardening cho Flutter",
40
+ description: "Ki\u1EC3m tra allowBackup, fullBackupContent, cleartext traffic v\xE0 network security config trong AndroidManifest/network config.",
41
+ severity: "warning",
42
+ category: "mobile-security",
43
+ languages: ["xml"],
44
+ scope: "flutter",
45
+ requires: "text",
46
+ baseConfidence: 82,
47
+ check(ctx) {
48
+ const file = ctx.file;
49
+ const content = file.content;
50
+ const out = [];
51
+ if (isPath(file, "androidmanifest.xml")) {
52
+ const appMatch = /<application\b[\s\S]*?>/i.exec(content);
53
+ if (!appMatch) return out;
54
+ const appTag = appMatch[0];
55
+ const appIndex = appMatch.index;
56
+ if (attrValue(appTag, "android:allowBackup") !== "false") {
57
+ out.push(
58
+ finding(
59
+ file,
60
+ appIndex,
61
+ 'Android application ch\u01B0a \u0111\u1EB7t `android:allowBackup="false"` r\xF5 r\xE0ng.',
62
+ '\u0110\u1EB7t `android:allowBackup="false"` tr\u1EEB khi c\xF3 y\xEAu c\u1EA7u backup \u0111\xE3 \u0111\u01B0\u1EE3c threat-model.'
63
+ )
64
+ );
65
+ }
66
+ if (attrValue(appTag, "android:fullBackupContent") !== "false") {
67
+ out.push(
68
+ finding(
69
+ file,
70
+ appIndex,
71
+ "Android application ch\u01B0a t\u1EAFt ho\u1EB7c gi\u1EDBi h\u1EA1n `fullBackupContent` r\xF5 r\xE0ng.",
72
+ '\u0110\u1EB7t `android:fullBackupContent="false"` ho\u1EB7c tr\u1ECF t\u1EDBi backup rules lo\u1EA1i tr\u1EEB d\u1EEF li\u1EC7u nh\u1EA1y c\u1EA3m.'
73
+ )
74
+ );
75
+ }
76
+ if (attrValue(appTag, "android:usesCleartextTraffic") === "true") {
77
+ out.push(
78
+ finding(
79
+ file,
80
+ appIndex,
81
+ "\u1EE8ng d\u1EE5ng b\u1EADt cleartext traffic \u1EDF AndroidManifest.",
82
+ "T\u1EAFt cleartext traffic ho\u1EB7c gi\u1EDBi h\u1EA1n b\u1EB1ng network security config cho \u0111\xFAng domain c\u1EA7n thi\u1EBFt.",
83
+ { severity: "error", confidence: 90 }
84
+ )
85
+ );
86
+ }
87
+ if (attrValue(appTag, "android:networkSecurityConfig") === null && attrValue(appTag, "android:usesCleartextTraffic") !== "false") {
88
+ out.push(
89
+ finding(
90
+ file,
91
+ appIndex,
92
+ "Manifest ch\u01B0a c\xF3 network security config ho\u1EB7c cleartext policy r\xF5 r\xE0ng.",
93
+ 'Khai b\xE1o `android:networkSecurityConfig` v\u1EDBi cleartext m\u1EB7c \u0111\u1ECBnh false, ho\u1EB7c \u0111\u1EB7t `android:usesCleartextTraffic="false"`.',
94
+ { confidence: 68 }
95
+ )
96
+ );
97
+ }
98
+ }
99
+ const cleartextIndex = firstIndex(content, /cleartextTrafficPermitted\s*=\s*["']true["']/i);
100
+ if (cleartextIndex >= 0) {
101
+ out.push(
102
+ finding(
103
+ file,
104
+ cleartextIndex,
105
+ "Network security config cho ph\xE9p cleartext traffic.",
106
+ "Ch\u1EC9 b\u1EADt cleartext cho domain n\u1ED9i b\u1ED9 th\u1EADt s\u1EF1 c\u1EA7n thi\u1EBFt; m\u1EB7c \u0111\u1ECBnh n\xEAn l\xE0 false v\xE0 \u01B0u ti\xEAn HTTPS.",
107
+ { severity: "error", confidence: 90 }
108
+ )
109
+ );
110
+ }
111
+ return out;
112
+ }
113
+ };
114
+
115
+ export { rule };
116
+ //# sourceMappingURL=android-manifest-hardening.rule.js.map
117
+ //# sourceMappingURL=android-manifest-hardening.rule.js.map
@@ -0,0 +1,87 @@
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
+ var attrValue = (xml, attr) => {
24
+ const escaped = attr.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
25
+ return new RegExp(`${escaped}\\s*=\\s*["']([^"']+)["']`).exec(xml)?.[1] ?? null;
26
+ };
27
+ var isPath = (file, suffix) => file.path.replace(/\\/g, "/").toLowerCase().endsWith(suffix.toLowerCase());
28
+
29
+ // builtin-rules/static/flutter/android-sensitive-permissions.rule.ts
30
+ var SENSITIVE_PERMISSIONS = /* @__PURE__ */ new Map([
31
+ ["android.permission.CAMERA", "camera"],
32
+ ["android.permission.RECORD_AUDIO", "microphone"],
33
+ ["android.permission.ACCESS_FINE_LOCATION", "precise location"],
34
+ ["android.permission.ACCESS_COARSE_LOCATION", "coarse location"],
35
+ ["android.permission.ACCESS_BACKGROUND_LOCATION", "background location"],
36
+ ["android.permission.READ_EXTERNAL_STORAGE", "external storage read"],
37
+ ["android.permission.WRITE_EXTERNAL_STORAGE", "external storage write"],
38
+ ["android.permission.MANAGE_EXTERNAL_STORAGE", "all files access"],
39
+ ["android.permission.READ_MEDIA_IMAGES", "media images"],
40
+ ["android.permission.READ_MEDIA_VIDEO", "media videos"],
41
+ ["android.permission.READ_MEDIA_AUDIO", "media audio"],
42
+ ["android.permission.READ_CONTACTS", "contacts read"],
43
+ ["android.permission.WRITE_CONTACTS", "contacts write"],
44
+ ["android.permission.READ_PHONE_STATE", "phone state"],
45
+ ["android.permission.CALL_PHONE", "phone call"],
46
+ ["android.permission.READ_SMS", "SMS read"],
47
+ ["android.permission.SEND_SMS", "SMS send"],
48
+ ["android.permission.POST_NOTIFICATIONS", "notifications"]
49
+ ]);
50
+ var rule = {
51
+ id: "flutter/android-sensitive-permissions",
52
+ version: 1,
53
+ kind: "static-ts",
54
+ title: "Android sensitive permissions c\u1EA7n review least privilege",
55
+ description: "Li\u1EC7t k\xEA permission nh\u1EA1y c\u1EA3m trong AndroidManifest \u0111\u1EC3 reviewer x\xE1c nh\u1EADn business need v\xE0 runtime prompt.",
56
+ severity: "warning",
57
+ category: "mobile-privacy",
58
+ languages: ["xml"],
59
+ scope: "flutter",
60
+ requires: "text",
61
+ baseConfidence: 78,
62
+ check(ctx) {
63
+ if (!isPath(ctx.file, "androidmanifest.xml")) return [];
64
+ const out = [];
65
+ for (const match of ctx.file.content.matchAll(/<uses-permission\b[\s\S]*?>/gi)) {
66
+ const block = match[0];
67
+ const permission = attrValue(block, "android:name");
68
+ if (!permission) continue;
69
+ const label = SENSITIVE_PERMISSIONS.get(permission);
70
+ if (!label) continue;
71
+ out.push(
72
+ finding(
73
+ ctx.file,
74
+ match.index ?? 0,
75
+ `Permission nh\u1EA1y c\u1EA3m \`${permission}\` (${label}) c\u1EA7n review least privilege.`,
76
+ "X\xE1c nh\u1EADn t\xEDnh n\u0103ng th\u1EADt s\u1EF1 c\u1EA7n permission n\xE0y, ki\u1EC3m tra runtime permission UX v\xE0 gi\u1EA3m scope/API theo phi\xEAn b\u1EA3n Android n\u1EBFu c\xF3 th\u1EC3.",
77
+ { severity: "info", confidence: 76 }
78
+ )
79
+ );
80
+ }
81
+ return out;
82
+ }
83
+ };
84
+
85
+ export { rule };
86
+ //# sourceMappingURL=android-sensitive-permissions.rule.js.map
87
+ //# sourceMappingURL=android-sensitive-permissions.rule.js.map