@eagleoutice/flowr 2.16.7 → 2.17.0

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 (106) hide show
  1. package/README.md +16 -10
  2. package/abstract-interpretation/absint-inference.d.ts +17 -1
  3. package/abstract-interpretation/absint-inference.js +118 -3
  4. package/abstract-interpretation/data-frame/arguments.d.ts +11 -1
  5. package/abstract-interpretation/data-frame/arguments.js +12 -0
  6. package/abstract-interpretation/domains/lattice.d.ts +2 -0
  7. package/abstract-interpretation/domains/lattice.js +0 -6
  8. package/abstract-interpretation/domains/multi-value-state-domain.d.ts +2 -1
  9. package/abstract-interpretation/domains/multi-value-state-domain.js +7 -3
  10. package/abstract-interpretation/domains/partial-product-domain.js +2 -1
  11. package/abstract-interpretation/domains/state-abstract-domain.d.ts +6 -3
  12. package/abstract-interpretation/domains/state-abstract-domain.js +13 -7
  13. package/abstract-interpretation/domains/state-domain.d.ts +4 -0
  14. package/config.js +1 -1
  15. package/control-flow/useless-loop.js +10 -8
  16. package/data/r-primitives.generated.d.ts +1 -0
  17. package/data/r-primitives.generated.js +9 -0
  18. package/data/sigdb/sigdb.remote.json +110 -110
  19. package/dataflow/environments/identifier.d.ts +1 -1
  20. package/dataflow/environments/query-fn-props.d.ts +9 -3
  21. package/dataflow/environments/query-fn-props.js +13 -5
  22. package/dataflow/environments/reference-to-maybe.js +1 -6
  23. package/dataflow/fn/class-declaration.js +1 -8
  24. package/dataflow/graph/dataflowgraph-builder.d.ts +4 -4
  25. package/dataflow/graph/df-helper.d.ts +2 -0
  26. package/dataflow/graph/df-helper.js +7 -0
  27. package/dataflow/graph/graph.js +3 -10
  28. package/dataflow/graph/vertex.d.ts +1 -1
  29. package/dataflow/hooks.d.ts +1 -1
  30. package/dataflow/info.d.ts +3 -3
  31. package/dataflow/internal/linker.js +1 -1
  32. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +2 -2
  33. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
  34. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +1 -7
  35. package/dataflow/processor.d.ts +1 -1
  36. package/documentation/wiki-linter.js +29 -0
  37. package/documentation/wiki-query.js +20 -1
  38. package/linter/linter-executor.js +2 -1
  39. package/linter/linter-rules.d.ts +65 -0
  40. package/linter/linter-rules.js +5 -1
  41. package/linter/rules/cmd-check/global-environment-modification.d.ts +14 -1
  42. package/linter/rules/cmd-check/global-environment-modification.js +15 -7
  43. package/linter/rules/no-leaked-credentials.d.ts +1 -0
  44. package/linter/rules/no-leaked-credentials.js +3 -3
  45. package/linter/rules/process-state-in-session.d.ts +71 -0
  46. package/linter/rules/process-state-in-session.js +267 -0
  47. package/linter/rules/secret-exfiltration.d.ts +80 -0
  48. package/linter/rules/secret-exfiltration.js +183 -0
  49. package/package.json +1 -1
  50. package/project/flowr-analyzer.d.ts +6 -0
  51. package/project/flowr-analyzer.js +4 -0
  52. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +2 -0
  53. package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -3
  54. package/project/sigdb/decompress.d.ts +4 -0
  55. package/project/sigdb/decompress.js +60 -25
  56. package/project/sigdb/manifest.d.ts +1 -1
  57. package/project/sigdb/manifest.js +2 -5
  58. package/project/sigdb/reader.js +15 -6
  59. package/project/sigdb/sigdb-download.d.ts +3 -7
  60. package/project/sigdb/sigdb-download.js +71 -72
  61. package/queries/catalog/taint-query/taint-query-executor.d.ts +7 -0
  62. package/queries/catalog/taint-query/taint-query-executor.js +30 -0
  63. package/queries/catalog/taint-query/taint-query-format.d.ts +29 -0
  64. package/queries/catalog/taint-query/taint-query-format.js +124 -0
  65. package/queries/query.d.ts +12 -1
  66. package/queries/query.js +2 -0
  67. package/taint-analysis/builder/domain.d.ts +14 -0
  68. package/taint-analysis/builder/domain.js +69 -0
  69. package/taint-analysis/builder/report-template.d.ts +50 -0
  70. package/taint-analysis/builder/report-template.js +46 -0
  71. package/taint-analysis/builder/taint-analysis-definition.d.ts +108 -0
  72. package/taint-analysis/builder/taint-analysis-definition.js +128 -0
  73. package/taint-analysis/builder/taint-analysis.d.ts +124 -0
  74. package/taint-analysis/builder/taint-analysis.js +93 -0
  75. package/taint-analysis/builtin-index-bridge.d.ts +20 -0
  76. package/taint-analysis/builtin-index-bridge.js +48 -0
  77. package/taint-analysis/eval/eval.d.ts +1 -0
  78. package/taint-analysis/eval/eval.js +124 -0
  79. package/taint-analysis/eval/instrumentation.d.ts +59 -0
  80. package/taint-analysis/eval/instrumentation.js +124 -0
  81. package/taint-analysis/finite-domain.d.ts +41 -0
  82. package/taint-analysis/finite-domain.js +118 -0
  83. package/taint-analysis/function-categories.d.ts +31 -0
  84. package/taint-analysis/function-categories.js +61 -0
  85. package/taint-analysis/logger.d.ts +1 -0
  86. package/taint-analysis/logger.js +6 -0
  87. package/taint-analysis/predefined/determinism.d.ts +6 -0
  88. package/taint-analysis/predefined/determinism.js +14 -0
  89. package/taint-analysis/predefined/normalization.d.ts +17 -0
  90. package/taint-analysis/predefined/normalization.js +150 -0
  91. package/taint-analysis/predefined/predefined.d.ts +12 -0
  92. package/taint-analysis/predefined/predefined.js +18 -0
  93. package/taint-analysis/predefined/randomness-analysis.d.ts +6 -0
  94. package/taint-analysis/predefined/randomness-analysis.js +124 -0
  95. package/taint-analysis/predefined/secret-analysis.d.ts +77 -0
  96. package/taint-analysis/predefined/secret-analysis.js +165 -0
  97. package/taint-analysis/predefined/security-analysis.d.ts +7 -0
  98. package/taint-analysis/predefined/security-analysis.js +91 -0
  99. package/taint-analysis/taint-mapping.d.ts +86 -0
  100. package/taint-analysis/taint-mapping.js +70 -0
  101. package/taint-analysis/taint-resolve.d.ts +26 -0
  102. package/taint-analysis/taint-resolve.js +86 -0
  103. package/taint-analysis/taint-visitor.d.ts +80 -0
  104. package/taint-analysis/taint-visitor.js +82 -0
  105. package/util/flowr-version.d.ts +1 -1
  106. package/util/flowr-version.js +2 -2
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizationReach = exports.normalizationKnownConstant = exports.normalizationDomain = exports.ZScore = exports.UnitVariance = exports.ZeroCentered = exports.MinMax = void 0;
4
+ const lattice_1 = require("../../abstract-interpretation/domains/lattice");
5
+ const taint_analysis_definition_1 = require("../builder/taint-analysis-definition");
6
+ const domain_1 = require("../builder/domain");
7
+ const function_categories_1 = require("../function-categories");
8
+ exports.MinMax = Symbol('Min-Max');
9
+ exports.ZeroCentered = Symbol('Zero Centered');
10
+ exports.UnitVariance = Symbol('Unit Variance');
11
+ exports.ZScore = Symbol('z-Score');
12
+ exports.normalizationDomain = new domain_1.FiniteDomainBuilder()
13
+ .addLeqOrder(lattice_1.Bottom, [exports.ZScore, exports.MinMax])
14
+ .addLeqOrder(exports.ZScore, [exports.ZeroCentered, exports.UnitVariance])
15
+ .addLeqOrder(exports.ZeroCentered, lattice_1.Top)
16
+ .addLeqOrder(exports.UnitVariance, lattice_1.Top)
17
+ .addLeqOrder(exports.MinMax, lattice_1.Top)
18
+ .build();
19
+ /** Yield bottom when the input carries one of the given normalization taints. */
20
+ const checkKnownConstant = (...checkedTaints) => {
21
+ return {
22
+ argDefinition: [{ pos: 0, name: 'x' }],
23
+ conditionFn: (_args, [taint]) => checkedTaints.includes(taint.value) ? lattice_1.Bottom : (taint.value ?? lattice_1.Top)
24
+ };
25
+ };
26
+ /** Yield bottom for any concrete normalization taint. */
27
+ const checkAnyNormalized = checkKnownConstant(exports.MinMax, exports.ZeroCentered, exports.UnitVariance, exports.ZScore);
28
+ /** Functions producing a normalized value. */
29
+ const normalizationSources = [
30
+ {
31
+ identifier: ['scale', "base" /* PkgName.Base */],
32
+ condition: {
33
+ argValues: [
34
+ { pos: 1, name: 'center', default: true },
35
+ { pos: 2, name: 'scale', default: true }
36
+ ],
37
+ argDefinition: [{ pos: 0, name: 'x' }],
38
+ conditionFn: ([center, scale], [taint]) => {
39
+ if (center === true && scale === true) {
40
+ return exports.ZScore;
41
+ }
42
+ else if (center === true) {
43
+ return exports.ZeroCentered;
44
+ }
45
+ else if (center === false && scale === false) {
46
+ return taint.value ?? lattice_1.Top;
47
+ }
48
+ return lattice_1.Top;
49
+ }
50
+ }
51
+ },
52
+ { identifier: ['rescale', 'scales'], taint: exports.MinMax },
53
+ ];
54
+ /** Transformations changing the normalization taint. */
55
+ const normalizationTransformers = [
56
+ // non-linear elementwise transformations
57
+ {
58
+ identifier: [
59
+ ['abs', "base" /* PkgName.Base */],
60
+ // Logarithms
61
+ ['log', "base" /* PkgName.Base */],
62
+ ['log2', "base" /* PkgName.Base */],
63
+ ['log10', "base" /* PkgName.Base */],
64
+ ['log1p', "base" /* PkgName.Base */],
65
+ // Exponentials
66
+ ['exp', "base" /* PkgName.Base */],
67
+ ['expm1', "base" /* PkgName.Base */],
68
+ ['sqrt', "base" /* PkgName.Base */],
69
+ // Rounding
70
+ ['sign', "base" /* PkgName.Base */],
71
+ ['signif', "base" /* PkgName.Base */],
72
+ ['floor', "base" /* PkgName.Base */],
73
+ ['ceiling', "base" /* PkgName.Base */],
74
+ ['trunc', "base" /* PkgName.Base */],
75
+ // Trigonometrics
76
+ ['sin', "base" /* PkgName.Base */],
77
+ ['cos', "base" /* PkgName.Base */],
78
+ ['tan', "base" /* PkgName.Base */],
79
+ ],
80
+ taint: lattice_1.Top
81
+ },
82
+ {
83
+ identifier: ['round', "base" /* PkgName.Base */],
84
+ condition: {
85
+ argDefinition: [{ pos: 0, name: 'x' }],
86
+ // Rounding only removes centering and variance assumption, min-max taint is kept
87
+ conditionFn: (_args, [taint]) => taint.value === exports.ZScore || taint.value === exports.ZeroCentered || taint.value === exports.UnitVariance ? lattice_1.Top : taint.value
88
+ }
89
+ },
90
+ {
91
+ identifier: [
92
+ // dropping elements
93
+ ['subset', "base" /* PkgName.Base */],
94
+ ['filter', "base" /* PkgName.Base */],
95
+ ['head', "utils" /* PkgName.Utils */],
96
+ ['tail', "utils" /* PkgName.Utils */],
97
+ // additional common functions
98
+ ['rep', "base" /* PkgName.Base */], ['rep.int', "base" /* PkgName.Base */], ['rep_len', "base" /* PkgName.Base */], ['which', "base" /* PkgName.Base */]
99
+ ],
100
+ taint: lattice_1.Top
101
+ },
102
+ ];
103
+ /**
104
+ * Detects summary statistics whose result is a statically known constant because the input carries a specific
105
+ * normalization taint (e.g. the mean of zero-centered data is 0, the sd of unit-variance data is 1).
106
+ */
107
+ exports.normalizationKnownConstant = taint_analysis_definition_1.TaintAnalysisDefinition.create('normalization-constant', exports.normalizationDomain)
108
+ .on(function_categories_1.TaintFnCategory.pureAlias)
109
+ // assumption: calculation on input data will usually destroy normalization
110
+ .on(function_categories_1.TaintFnCategory.pureComputer, (_args, _taints) => lattice_1.Top)
111
+ .on(function_categories_1.TaintFnCategory.pureShape, (_args, _taints) => lattice_1.Top)
112
+ .from(...normalizationSources)
113
+ .through(...normalizationTransformers)
114
+ .to({ identifier: ['mean', "base" /* PkgName.Base */], condition: checkKnownConstant(exports.ZeroCentered, exports.ZScore) }, { identifier: ['sd', "stats" /* PkgName.Stats */], condition: checkKnownConstant(exports.UnitVariance, exports.ZScore) }, { identifier: ['var', "stats" /* PkgName.Stats */], condition: checkKnownConstant(exports.UnitVariance, exports.ZScore) }, { identifier: [['min', "base" /* PkgName.Base */], ['max', "base" /* PkgName.Base */], ['range', "base" /* PkgName.Base */]], condition: checkKnownConstant(exports.MinMax) }).report((f) => {
115
+ return f.functionName ? `${f.functionName} calculated on normalized data yields a known result [${f.locString}]` : `Known summary statistic calculated on normalized data [${f.locString}]`;
116
+ });
117
+ /**
118
+ * Detects any normalized value reaching any summary statistic, regardless of which normalization was applied
119
+ * or whether the result is a statically known constant.
120
+ */
121
+ exports.normalizationReach = taint_analysis_definition_1.TaintAnalysisDefinition.create('normalization-reach', exports.normalizationDomain)
122
+ .on(function_categories_1.TaintFnCategory.pureAlias)
123
+ // assumption: calculation on input data will usually destroy normalization
124
+ .on(function_categories_1.TaintFnCategory.pureComputer, (_args, _taints) => lattice_1.Top)
125
+ .on(function_categories_1.TaintFnCategory.pureShape, (_args, _taints) => lattice_1.Top)
126
+ .from(...normalizationSources)
127
+ .through(...normalizationTransformers)
128
+ .to({
129
+ identifier: [
130
+ ['mean', "base" /* PkgName.Base */],
131
+ ['sum', "base" /* PkgName.Base */],
132
+ ['median', "stats" /* PkgName.Stats */],
133
+ ['quantile', "stats" /* PkgName.Stats */],
134
+ ['range', "base" /* PkgName.Base */],
135
+ ['min', "base" /* PkgName.Base */],
136
+ ['max', "base" /* PkgName.Base */],
137
+ ['sd', "stats" /* PkgName.Stats */],
138
+ ['var', "stats" /* PkgName.Stats */],
139
+ ['IQR', "stats" /* PkgName.Stats */],
140
+ ['fivenum', "stats" /* PkgName.Stats */],
141
+ ['colMeans', "base" /* PkgName.Base */],
142
+ ['rowMeans', "base" /* PkgName.Base */],
143
+ ['colSums', "base" /* PkgName.Base */],
144
+ ['rowSums', "base" /* PkgName.Base */],
145
+ ],
146
+ condition: checkAnyNormalized
147
+ }).report((f) => {
148
+ return f.functionName ? `${f.functionName} calculated on normalized data [${f.locString}]` : `Summary statistic calculated on normalized data [${f.locString}]`;
149
+ });
150
+ //# sourceMappingURL=normalization.js.map
@@ -0,0 +1,12 @@
1
+ import type { TaintAnalysisDefinition } from '../builder/taint-analysis-definition';
2
+ export declare const predefinedTaintAnalyses: {
3
+ readonly 'normalization-constant': TaintAnalysisDefinition<"normalization-constant", import("../finite-domain").FiniteDomain<typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, [typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, typeof import("./normalization").MinMax, typeof import("./normalization").ZeroCentered, typeof import("./normalization").UnitVariance, typeof import("./normalization").ZScore]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
4
+ readonly 'normalization-reach': TaintAnalysisDefinition<"normalization-reach", import("../finite-domain").FiniteDomain<typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, [typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, typeof import("./normalization").MinMax, typeof import("./normalization").ZeroCentered, typeof import("./normalization").UnitVariance, typeof import("./normalization").ZScore]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
5
+ readonly security: TaintAnalysisDefinition<"security", import("../finite-domain").FiniteDomain<typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, [typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, typeof import("./security-analysis").UserInput, typeof import("./security-analysis").NetworkInput, typeof import("./security-analysis").FileInput]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
6
+ readonly randomness: TaintAnalysisDefinition<"randomness", import("../finite-domain").FiniteDomain<typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, [typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, typeof import("./randomness-analysis").Random, typeof import("./randomness-analysis").Deterministic]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
7
+ readonly determinism: import("../builder/taint-analysis-definition").CompositeTaintAnalysisDefinition<"determinism">;
8
+ readonly secret: TaintAnalysisDefinition<"secret", import("../finite-domain").FiniteDomain<typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, [typeof import("../../abstract-interpretation/domains/lattice").Top, typeof import("../../abstract-interpretation/domains/lattice").Bottom, typeof import("./secret-analysis").Credential, typeof import("./secret-analysis").Secret, typeof import("./secret-analysis").FileContent, typeof import("./secret-analysis").Response]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
9
+ };
10
+ export declare const allPredefinedTaintAnalysisNames: AnyPredefinedTaintAnalysisName[];
11
+ export type AnyPredefinedTaintAnalysisName = keyof typeof predefinedTaintAnalyses;
12
+ export type AllPredefinedTaintAnalysisNames = [AnyPredefinedTaintAnalysisName];
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allPredefinedTaintAnalysisNames = exports.predefinedTaintAnalyses = void 0;
4
+ const normalization_1 = require("./normalization");
5
+ const security_analysis_1 = require("./security-analysis");
6
+ const randomness_analysis_1 = require("./randomness-analysis");
7
+ const determinism_1 = require("./determinism");
8
+ const secret_analysis_1 = require("./secret-analysis");
9
+ exports.predefinedTaintAnalyses = {
10
+ 'normalization-constant': normalization_1.normalizationKnownConstant,
11
+ 'normalization-reach': normalization_1.normalizationReach,
12
+ 'security': security_analysis_1.securityAnalysis,
13
+ 'randomness': randomness_analysis_1.randomnessAnalysis,
14
+ 'determinism': determinism_1.determinism,
15
+ 'secret': secret_analysis_1.secretAnalysis
16
+ };
17
+ exports.allPredefinedTaintAnalysisNames = Object.keys(exports.predefinedTaintAnalyses);
18
+ //# sourceMappingURL=predefined.js.map
@@ -0,0 +1,6 @@
1
+ import { Bottom, Top } from '../../abstract-interpretation/domains/lattice';
2
+ import { TaintAnalysisDefinition } from '../builder/taint-analysis-definition';
3
+ export declare const Random: unique symbol;
4
+ export declare const Deterministic: unique symbol;
5
+ export declare const randomnessDomain: import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof Random, typeof Deterministic]>;
6
+ export declare const randomnessAnalysis: TaintAnalysisDefinition<"randomness", import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof Random, typeof Deterministic]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.randomnessAnalysis = exports.randomnessDomain = exports.Deterministic = exports.Random = void 0;
4
+ const lattice_1 = require("../../abstract-interpretation/domains/lattice");
5
+ const abstract_domain_1 = require("../../abstract-interpretation/domains/abstract-domain");
6
+ const taint_analysis_definition_1 = require("../builder/taint-analysis-definition");
7
+ const domain_1 = require("../builder/domain");
8
+ const identifier_1 = require("../../dataflow/environments/identifier");
9
+ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
10
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
11
+ const function_categories_1 = require("../function-categories");
12
+ const builtin_index_bridge_1 = require("../builtin-index-bridge");
13
+ exports.Random = Symbol('Random');
14
+ exports.Deterministic = Symbol('Deterministic');
15
+ exports.randomnessDomain = new domain_1.FiniteDomainBuilder()
16
+ .addLeqOrder(lattice_1.Bottom, [exports.Random, exports.Deterministic])
17
+ .addLeqOrder(exports.Random, lattice_1.Top)
18
+ .addLeqOrder(exports.Deterministic, lattice_1.Top)
19
+ .build();
20
+ const randomnessSinkCondition = (_args, taints) => taints.some(taint => taint.value === exports.Random) ? lattice_1.Bottom
21
+ : taints.length > 0 ? abstract_domain_1.AbstractDomain.joinAll(taints).value : lattice_1.Top;
22
+ exports.randomnessAnalysis = taint_analysis_definition_1.TaintAnalysisDefinition.create('randomness', exports.randomnessDomain)
23
+ .on(function_categories_1.TaintFnCategory.pureAlias)
24
+ // propagate randomness if any incoming argument is random
25
+ .on(function_categories_1.TaintFnCategory.pureComputer, ([_arg], taints) => {
26
+ if (taints.some(t => t?.value === exports.Random)) {
27
+ return exports.Random;
28
+ }
29
+ if (taints.length > 0) {
30
+ return abstract_domain_1.AbstractDomain.joinAll(taints).value;
31
+ }
32
+ return lattice_1.Top;
33
+ })
34
+ // assumption: randomness seldomly affects shape of data
35
+ .on(function_categories_1.TaintFnCategory.pureShape, (_args, _taints) => lattice_1.Top)
36
+ .from({
37
+ identifier: [
38
+ // vector constructor functions
39
+ ['vector', "base" /* PkgName.Base */],
40
+ ['numeric', "base" /* PkgName.Base */],
41
+ ['double', "base" /* PkgName.Base */],
42
+ ['integer', "base" /* PkgName.Base */],
43
+ ['logical', "base" /* PkgName.Base */],
44
+ ['complex', "base" /* PkgName.Base */],
45
+ ['raw', "base" /* PkgName.Base */],
46
+ ['character', "base" /* PkgName.Base */],
47
+ ['single', "base" /* PkgName.Base */],
48
+ ['mat.or.vec', "base" /* PkgName.Base */],
49
+ // type checks
50
+ ['is.vector', "base" /* PkgName.Base */],
51
+ ['is.numeric', "base" /* PkgName.Base */],
52
+ ['is.double', "base" /* PkgName.Base */],
53
+ ['is.integer', "base" /* PkgName.Base */],
54
+ ['is.logical', "base" /* PkgName.Base */],
55
+ ['is.complex', "base" /* PkgName.Base */],
56
+ ['is.raw', "base" /* PkgName.Base */],
57
+ ['is.character', "base" /* PkgName.Base */],
58
+ ['is.single', "base" /* PkgName.Base */],
59
+ ['is.matrix', "base" /* PkgName.Base */],
60
+ ['is.factor', "base" /* PkgName.Base */],
61
+ ['is.ordered', "base" /* PkgName.Base */],
62
+ // sequence functions
63
+ ['seq', "base" /* PkgName.Base */],
64
+ ['seq.Date', "base" /* PkgName.Base */],
65
+ ['seq.POSIXt', "base" /* PkgName.Base */],
66
+ ['sequence', "base" /* PkgName.Base */],
67
+ ['seq_along', "base" /* PkgName.Base */],
68
+ ['seq_len', "base" /* PkgName.Base */],
69
+ ],
70
+ taint: exports.Deterministic
71
+ }, {
72
+ identifier: [...query_fn_props_1.BuiltInIndex.default().with(built_in_props_1.SemanticCallTag.Random)]
73
+ // Exclude set.seed as it does not return a Random value
74
+ .filter(i => !identifier_1.Identifier.matches(i, ['set.seed', "base" /* PkgName.Base */])),
75
+ taint: exports.Random
76
+ })
77
+ .through({
78
+ identifier: [
79
+ // coercion
80
+ ['as.vector', "base" /* PkgName.Base */],
81
+ ['as.numeric', "base" /* PkgName.Base */],
82
+ ['as.double', "base" /* PkgName.Base */],
83
+ ['as.integer', "base" /* PkgName.Base */],
84
+ ['as.logical', "base" /* PkgName.Base */],
85
+ ['as.complex', "base" /* PkgName.Base */],
86
+ ['as.raw', "base" /* PkgName.Base */],
87
+ ['as.character', "base" /* PkgName.Base */],
88
+ ['as.single', "base" /* PkgName.Base */],
89
+ ['as.matrix', "base" /* PkgName.Base */],
90
+ ['as.factor', "base" /* PkgName.Base */],
91
+ ['as.ordered', "base" /* PkgName.Base */],
92
+ // repetition
93
+ ['rep', "base" /* PkgName.Base */], ['rep.int', "base" /* PkgName.Base */], ['rep_len', "base" /* PkgName.Base */],
94
+ // additional common functions
95
+ ['which', "base" /* PkgName.Base */]
96
+ ],
97
+ condition: {
98
+ argDefinition: [{ pos: 0, name: 'x' }],
99
+ conditionFn: (_args, [taint]) => taint.value
100
+ }
101
+ })
102
+ .to({
103
+ identifier: ['summary', "base" /* PkgName.Base */],
104
+ condition: {
105
+ argDefinition: [{ pos: 0, name: 'object' }],
106
+ conditionFn: randomnessSinkCondition
107
+ }
108
+ }, {
109
+ identifier: ['lm', "base" /* PkgName.Base */],
110
+ condition: {
111
+ argDefinition: [{ pos: 0, name: 'formula' }, { pos: 1, name: 'data' }],
112
+ conditionFn: randomnessSinkCondition
113
+ }
114
+ }, {
115
+ identifier: ['ggplot', "ggplot2" /* PkgName.GgPlot2 */],
116
+ condition: {
117
+ argDefinition: [{ pos: 0, name: 'data' }],
118
+ conditionFn: randomnessSinkCondition
119
+ }
120
+ }, ...(0, builtin_index_bridge_1.taintMappingFromBuiltInIndex)([built_in_props_1.SemanticCallTag.Writes, built_in_props_1.SemanticCallTag.Graphics], built_in_props_1.ArgProp.Value, randomnessSinkCondition)).report((f) => {
121
+ return f.functionName ? `Randomness reached write/graphics function '${f.functionName}' [${f.locString}]`
122
+ : `Randomness reached a write/graphics function [${f.locString}]`;
123
+ });
124
+ //# sourceMappingURL=randomness-analysis.js.map
@@ -0,0 +1,77 @@
1
+ import { Bottom, Top } from '../../abstract-interpretation/domains/lattice';
2
+ import { TaintAnalysisDefinition } from '../builder/taint-analysis-definition';
3
+ import { Identifier } from '../../dataflow/environments/identifier';
4
+ import type { TaintParameterLocation } from '../taint-mapping';
5
+ /** A confidential value, e.g., an API key read from the environment */
6
+ export declare const Secret: unique symbol;
7
+ /** A secret placed into an authentication channel, e.g., `httr::authenticate(user, key)` */
8
+ export declare const Credential: unique symbol;
9
+ /** The content of a file that may hold secrets, as no file is trusted by default */
10
+ export declare const FileContent: unique symbol;
11
+ /** A server response that keeps the credentials of its request, shown only when the whole object is written out */
12
+ export declare const Response: unique symbol;
13
+ export declare const secretDomain: import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof Credential, typeof Secret, typeof FileContent, typeof Response]>;
14
+ /** Environment variable names that hold credentials */
15
+ export declare const CredentialNamePattern: RegExp;
16
+ /** Files that hold credentials */
17
+ export declare const CredentialFilePattern: RegExp;
18
+ /** How far the content of files is trusted not to hold secrets: `none` (any file but trusted ones may hold secrets) or only `credential-files` */
19
+ export declare enum FileTrust {
20
+ None = "none",
21
+ CredentialFiles = "credential-files"
22
+ }
23
+ /** Urls of endpoints that answer with a token */
24
+ export declare const TokenUrlPattern: RegExp;
25
+ /** Where a secret goes when it reaches a sink, `auth` being an authentication channel, the intended use */
26
+ export declare enum SecretSinkClass {
27
+ Network = "network",
28
+ Auth = "auth",
29
+ Browser = "browser",
30
+ Logs = "logs",
31
+ Files = "files",
32
+ Process = "process",
33
+ Llm = "llm"
34
+ }
35
+ /** functions through which a secret leaves the process */
36
+ export interface SecretSink {
37
+ readonly class: SecretSinkClass;
38
+ readonly fns: readonly Identifier[];
39
+ /** the destination argument (url, host, or request) */
40
+ readonly destination?: TaintParameterLocation;
41
+ /** whether all arguments end up in the url, and thus in server logs */
42
+ readonly inUrl?: boolean;
43
+ /** an argument redirecting output to a file */
44
+ readonly file?: TaintParameterLocation;
45
+ /** what the call returns: the request it builds, holding its secrets, or the response of the server */
46
+ readonly returns?: 'request' | 'response';
47
+ /** whether it writes out the whole object, including the fields print methods hide */
48
+ readonly serializes?: boolean;
49
+ }
50
+ export declare const DefaultSecretSinks: readonly SecretSink[];
51
+ /** Extensions of the {@link secretAnalysis} */
52
+ export interface SecretAnalysisOptions {
53
+ /** environment variable names holding credentials, defaults to {@link CredentialNamePattern} */
54
+ readonly credentialNamePattern?: RegExp;
55
+ /** functions whose result is secret */
56
+ readonly sources?: readonly Identifier[];
57
+ /** functions whose result is never secret */
58
+ readonly declassifiers?: readonly Identifier[];
59
+ /** where secrets leave the process, defaults to {@link DefaultSecretSinks} */
60
+ readonly sinks?: readonly SecretSink[];
61
+ /** how far files are trusted, defaults to {@link FileTrust.None} */
62
+ readonly fileTrust?: FileTrust;
63
+ /** paths of files holding secrets, in addition to {@link CredentialFilePattern} */
64
+ readonly secretFiles?: RegExp;
65
+ /** paths of files holding no secrets */
66
+ readonly trustedFiles?: RegExp;
67
+ }
68
+ /** The {@link secretAnalysis}, extended by the given options */
69
+ export declare function createSecretAnalysis({ credentialNamePattern, sources, declassifiers, sinks, fileTrust, secretFiles, trustedFiles }?: SecretAnalysisOptions): TaintAnalysisDefinition<"secret", import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof Credential, typeof Secret, typeof FileContent, typeof Response]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
70
+ /**
71
+ * Tracks secrets (environment, keyrings, config, credential files, tokens, password prompts) to where they leave the process.
72
+ * By default, the content of any file may hold secrets ({@link FileContent}), see {@link FileTrust}.
73
+ * Hashes and presence checks declassify them, authentication channels make them a {@link Credential}, and requests carrying
74
+ * them return a {@link Response}, or a new secret from a token endpoint.
75
+ * Network calls are no findings here, as whether sending a secret leaks it depends on the destination (see `secret-exfiltration`).
76
+ */
77
+ export declare const secretAnalysis: TaintAnalysisDefinition<"secret", import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof Credential, typeof Secret, typeof FileContent, typeof Response]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.secretAnalysis = exports.DefaultSecretSinks = exports.SecretSinkClass = exports.TokenUrlPattern = exports.FileTrust = exports.CredentialFilePattern = exports.CredentialNamePattern = exports.secretDomain = exports.Response = exports.FileContent = exports.Credential = exports.Secret = void 0;
4
+ exports.createSecretAnalysis = createSecretAnalysis;
5
+ const lattice_1 = require("../../abstract-interpretation/domains/lattice");
6
+ const taint_analysis_definition_1 = require("../builder/taint-analysis-definition");
7
+ const domain_1 = require("../builder/domain");
8
+ const identifier_1 = require("../../dataflow/environments/identifier");
9
+ const function_categories_1 = require("../function-categories");
10
+ const query_fn_props_1 = require("../../dataflow/environments/query-fn-props");
11
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
12
+ const builtin_index_bridge_1 = require("../builtin-index-bridge");
13
+ /** A confidential value, e.g., an API key read from the environment */
14
+ exports.Secret = Symbol('Secret');
15
+ /** A secret placed into an authentication channel, e.g., `httr::authenticate(user, key)` */
16
+ exports.Credential = Symbol('Credential');
17
+ /** The content of a file that may hold secrets, as no file is trusted by default */
18
+ exports.FileContent = Symbol('FileContent');
19
+ /** A server response that keeps the credentials of its request, shown only when the whole object is written out */
20
+ exports.Response = Symbol('Response');
21
+ exports.secretDomain = new domain_1.FiniteDomainBuilder()
22
+ .addLeqOrder(lattice_1.Bottom, [exports.Credential])
23
+ .addLeqOrder(exports.Credential, [exports.Secret])
24
+ .addLeqOrder(exports.Secret, [exports.FileContent])
25
+ .addLeqOrder(exports.FileContent, [exports.Response])
26
+ .addLeqOrder(exports.Response, lattice_1.Top)
27
+ .build();
28
+ /** Environment variable names that hold credentials */
29
+ exports.CredentialNamePattern = /key|token|secret|pass(?:word)?|pwd|cred|auth|private/i;
30
+ /** Files that hold credentials */
31
+ exports.CredentialFilePattern = /(?:^|[\\/])(?:\.Renviron|[._]netrc|\.pgpass|\.git-credentials|credentials(?:\.\w+)?)$/i;
32
+ /** How far the content of files is trusted not to hold secrets: `none` (any file but trusted ones may hold secrets) or only `credential-files` */
33
+ var FileTrust;
34
+ (function (FileTrust) {
35
+ FileTrust["None"] = "none";
36
+ FileTrust["CredentialFiles"] = "credential-files";
37
+ })(FileTrust || (exports.FileTrust = FileTrust = {}));
38
+ /** Urls of endpoints that answer with a token */
39
+ exports.TokenUrlPattern = /oauth|token|\/auth(?:enticate)?\b|\blogin\b|grant_type/i;
40
+ /** Where a secret goes when it reaches a sink, `auth` being an authentication channel, the intended use */
41
+ var SecretSinkClass;
42
+ (function (SecretSinkClass) {
43
+ SecretSinkClass["Network"] = "network";
44
+ SecretSinkClass["Auth"] = "auth";
45
+ SecretSinkClass["Browser"] = "browser";
46
+ SecretSinkClass["Logs"] = "logs";
47
+ SecretSinkClass["Files"] = "files";
48
+ SecretSinkClass["Process"] = "process";
49
+ SecretSinkClass["Llm"] = "llm";
50
+ })(SecretSinkClass || (exports.SecretSinkClass = SecretSinkClass = {}));
51
+ const index = query_fn_props_1.BuiltInIndex.default();
52
+ /** functions by package, as `pkg: f g; other: h`, with `$` for methods */
53
+ const fns = (spec) => spec.split(';').flatMap(group => {
54
+ const [pkg, names] = group.split(':').map(p => p.trim());
55
+ return pkg === '$' ? names.split(' ').map(n => identifier_1.Identifier.make(`$${n}`)) : identifier_1.Identifier.fromAll(pkg, names.split(' '));
56
+ });
57
+ const logLevels = 'trace debug info success warn error fatal'.split(' ');
58
+ exports.DefaultSecretSinks = [
59
+ { class: SecretSinkClass.Network, fns: fns('httr: GET POST PUT PATCH DELETE HEAD'), destination: { pos: 0, name: 'url' }, returns: 'response' },
60
+ { class: SecretSinkClass.Network, fns: fns('httr: VERB'), destination: { pos: 1, name: 'url' }, returns: 'response' },
61
+ { class: SecretSinkClass.Network, fns: fns('httr2: request'), destination: { pos: 0, name: 'base_url' }, inUrl: true, returns: 'request' },
62
+ { class: SecretSinkClass.Network, fns: fns('httr2: req_url req_url_query req_url_path req_url_path_append'), destination: { pos: 0, name: 'req' }, inUrl: true, returns: 'request' },
63
+ { class: SecretSinkClass.Network, fns: fns('httr2: req_body_json req_body_form req_body_raw req_body_multipart req_body_file'), destination: { pos: 0, name: 'req' }, returns: 'request' },
64
+ { class: SecretSinkClass.Network, fns: fns('curl: curl_fetch_memory curl_fetch_disk curl_fetch_stream curl curl_download; RCurl: getURL getURLContent postForm getForm'), destination: { pos: 0, name: 'url' }, inUrl: true, returns: 'response' },
65
+ { class: SecretSinkClass.Network, fns: fns('utils: download.file; base: url'), destination: { pos: 0 }, inUrl: true },
66
+ { class: SecretSinkClass.Network, fns: fns('base: socketConnection'), destination: { pos: 0, name: 'host' } },
67
+ { class: SecretSinkClass.Auth, fns: fns('httr2: req_auth_bearer_token req_auth_basic req_headers req_oauth_client_credentials req_oauth_password req_oauth_refresh req_oauth_bearer_jwt req_oauth_auth_code req_auth_aws_v4'), destination: { pos: 0, name: 'req' } },
68
+ { class: SecretSinkClass.Auth, fns: fns('DBI: dbConnect'), destination: { pos: -1, name: 'host' } },
69
+ { class: SecretSinkClass.Auth, fns: fns('httr2: oauth_client; httr: oauth_app; curl: new_handle handle_setheaders handle_setopt') },
70
+ { class: SecretSinkClass.Browser, fns: fns('shiny: renderPrint renderText renderUI renderTable renderDataTable HTML showNotification updateTextInput updateTextAreaInput textInput textAreaInput passwordInput; htmltools: HTML; DT: renderDT renderDataTable datatable; shinyjs: runjs html; $: sendCustomMessage sendInputMessage sendBinaryMessage') },
71
+ { class: SecretSinkClass.Logs, fns: fns('base: cat'), file: { pos: -1, name: 'file' } },
72
+ { class: SecretSinkClass.Logs, fns: fns('base: writeLines'), file: { pos: 1, name: 'con' } },
73
+ { class: SecretSinkClass.Files, fns: fns('base: saveRDS save dput dump serialize; readr: write_rds'), serializes: true },
74
+ { class: SecretSinkClass.Logs, fns: fns('utils: str'), serializes: true },
75
+ { class: SecretSinkClass.Logs, fns: [
76
+ ...index.with(built_in_props_1.SemanticCallTag.Prints),
77
+ ...identifier_1.Identifier.fromAll('logger', logLevels.map(l => `log_${l}`)),
78
+ ...identifier_1.Identifier.fromAll('futile.logger', logLevels.map(l => `flog.${l}`)),
79
+ ...fns('base: stop packageStartupMessage; rlang: inform abort; cli: cli_alert cli_alert_info cli_alert_success cli_alert_warning cli_alert_danger cli_inform cli_warn cli_abort cli_text; clipr: write_clip')
80
+ ] },
81
+ { class: SecretSinkClass.Files, fns: [...index.withAll([built_in_props_1.SemanticCallTag.File, built_in_props_1.SemanticCallTag.Writes]), ...fns('utils: write.csv write.csv2 write.table; base: writeBin; DBI: dbWriteTable dbAppendTable; pins: pin_write; googlesheets4: sheet_write write_sheet sheet_append; aws.s3: s3saveRDS put_object')] },
82
+ { class: SecretSinkClass.Process, fns: [...index.with(built_in_props_1.SemanticCallTag.Process), ...fns('utils: browseURL')] },
83
+ { class: SecretSinkClass.Llm, fns: fns('ellmer: chat chat_openai chat_anthropic chat_claude chat_gemini chat_google_gemini chat_ollama chat_mistral chat_groq chat_azure_openai chat_bedrock; openai: create_chat_completion create_completion; $: chat stream chat_async stream_async chat_structured set_system_prompt') }
84
+ ];
85
+ /** functions reading the body of a response */
86
+ const BodyReaders = fns('httr: content; httr2: resp_body_string resp_body_json resp_body_raw resp_body_html resp_body_xml');
87
+ /** functions sending a built request, returning the response */
88
+ const Performers = fns('httr2: req_perform req_perform_sequential req_perform_parallel req_perform_iterative');
89
+ const has = (taints, ...values) => taints.some(t => values.includes(t?.value));
90
+ const isSecret = (taints) => has(taints, exports.Secret, exports.Credential, exports.FileContent);
91
+ /** the first of `order` among the arguments, ignoring constants (Top) */
92
+ const strongest = (...order) => (_args, taints) => order.find(v => has(taints, v)) ?? lattice_1.Top;
93
+ const strongestSecret = strongest(exports.Secret, exports.Credential, exports.FileContent, exports.Response);
94
+ const strings = (value) => (Array.isArray(value) ? value : [value]).filter(v => typeof v === 'string');
95
+ /** the response to a request carrying a secret: a token endpoint answers with a new secret */
96
+ const responseTaint = ([url], taints) => !isSecret(taints) ? strongestSecret([], taints) : typeof url === 'string' && exports.TokenUrlPattern.test(url) ? exports.Secret : exports.Response;
97
+ /** a response is secret only from a token endpoint, the credentials it keeps are not part of its body */
98
+ const bodyTaint = strongest(exports.Secret, exports.FileContent);
99
+ /** The {@link secretAnalysis}, extended by the given options */
100
+ function createSecretAnalysis({ credentialNamePattern = exports.CredentialNamePattern, sources = [], declassifiers = [], sinks = exports.DefaultSecretSinks, fileTrust = FileTrust.None, secretFiles, trustedFiles } = {}) {
101
+ const fileTaint = ([path]) => {
102
+ const paths = strings(path);
103
+ if (paths.some(p => exports.CredentialFilePattern.test(p) || secretFiles?.test(p))) {
104
+ return exports.Secret;
105
+ }
106
+ return fileTrust === FileTrust.CredentialFiles || (paths.length > 0 && paths.every(p => trustedFiles?.test(p))) ? lattice_1.Top : exports.FileContent;
107
+ };
108
+ const credentialNameTaint = ([name]) => strings(name).length === 0 || strings(name).some(n => credentialNamePattern.test(n)) ? exports.Secret : lattice_1.Top;
109
+ const sinksOf = (keep) => sinks.filter(keep).flatMap(s => s.fns);
110
+ return taint_analysis_definition_1.TaintAnalysisDefinition.create('secret', exports.secretDomain)
111
+ .on(function_categories_1.TaintFnCategory.pureAlias)
112
+ .on(function_categories_1.TaintFnCategory.pureComputer, strongestSecret)
113
+ .on(function_categories_1.TaintFnCategory.pureShape, () => lattice_1.Top)
114
+ .from({
115
+ identifier: ['Sys.getenv', "base" /* PkgName.Base */],
116
+ condition: { argValues: [{ pos: 0, name: 'x' }], conditionFn: credentialNameTaint }
117
+ }, {
118
+ identifier: [
119
+ ...fns('keyring: key_get key_get_raw; config: get; base: readRenviron; httr: oauth2.0_token oauth1.0_token oauth_service_token; gargle: token_fetch credentials_service_account credentials_user_oauth2 credentials_app_default'),
120
+ ...fns('httr2: oauth_flow_auth_code oauth_flow_client_credentials oauth_flow_password oauth_flow_refresh oauth_flow_device oauth_flow_bearer_jwt oauth_flow_token_exchange oauth_token_cached'),
121
+ ...fns('AzureAuth: get_azure_token; gh: gh_token; gitcreds: gitcreds_get; askpass: askpass; getPass: getPass; rstudioapi: askForPassword askForSecret'),
122
+ ...sources
123
+ ],
124
+ taint: exports.Secret
125
+ }, ...(0, builtin_index_bridge_1.argValueMappingFromBuiltInIndex)(built_in_props_1.FileInputProps, built_in_props_1.ArgProp.Resource, fileTaint))
126
+ .through({
127
+ identifier: [
128
+ ...fns('digest: digest sha1 hmac; openssl: sha1 sha256 sha512 md5 sha2; sodium: password_store hash sha256; base: nzchar is.na is.null nchar identical == != isTRUE isFALSE'),
129
+ ...declassifiers
130
+ ],
131
+ taint: lattice_1.Top
132
+ }, {
133
+ identifier: [...fns('base: $ [[ [ @'), ...BodyReaders],
134
+ condition: { argDefinition: [{ pos: 0 }], conditionFn: bodyTaint }
135
+ }, {
136
+ identifier: fns('base: enc2utf8 trimws unname rawToChar do.call; utils: URLencode; jsonlite: fromJSON parse_json toJSON base64_enc; base64enc: base64encode'),
137
+ condition: { argDefinition: [{ pos: 0 }], conditionFn: strongestSecret }
138
+ }, {
139
+ identifier: [...fns('httr: authenticate add_headers config'), ...sinksOf(s => s.class === SecretSinkClass.Auth)],
140
+ condition: { allArgs: true, conditionFn: (_args, taints) => isSecret(taints) ? exports.Credential : lattice_1.Top }
141
+ }, {
142
+ identifier: sinksOf(s => s.returns === 'request'),
143
+ condition: { allArgs: true, conditionFn: strongestSecret }
144
+ }, {
145
+ identifier: [...Performers, ...sinksOf(s => s.returns === 'response')],
146
+ condition: { argValues: [{ pos: 0, name: 'url' }], allArgs: true, conditionFn: responseTaint }
147
+ })
148
+ .to({
149
+ identifier: sinksOf(s => s.serializes === true),
150
+ condition: { allArgs: true, conditionFn: (_args, taints) => has(taints, exports.Secret, exports.Credential, exports.FileContent, exports.Response) ? lattice_1.Bottom : undefined }
151
+ }, {
152
+ identifier: sinksOf(s => s.class !== SecretSinkClass.Auth && s.class !== SecretSinkClass.Network && !s.serializes),
153
+ condition: { allArgs: true, conditionFn: (_args, taints) => isSecret(taints) ? lattice_1.Bottom : undefined }
154
+ })
155
+ .report(f => `A secret reaches '${f.functionName ?? f.lexeme}', where it leaves the process [${f.locString}]`);
156
+ }
157
+ /**
158
+ * Tracks secrets (environment, keyrings, config, credential files, tokens, password prompts) to where they leave the process.
159
+ * By default, the content of any file may hold secrets ({@link FileContent}), see {@link FileTrust}.
160
+ * Hashes and presence checks declassify them, authentication channels make them a {@link Credential}, and requests carrying
161
+ * them return a {@link Response}, or a new secret from a token endpoint.
162
+ * Network calls are no findings here, as whether sending a secret leaks it depends on the destination (see `secret-exfiltration`).
163
+ */
164
+ exports.secretAnalysis = createSecretAnalysis();
165
+ //# sourceMappingURL=secret-analysis.js.map
@@ -0,0 +1,7 @@
1
+ import { Bottom, Top } from '../../abstract-interpretation/domains/lattice';
2
+ import { TaintAnalysisDefinition } from '../builder/taint-analysis-definition';
3
+ export declare const UserInput: unique symbol;
4
+ export declare const NetworkInput: unique symbol;
5
+ export declare const FileInput: unique symbol;
6
+ export declare const securityDomain: import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof UserInput, typeof NetworkInput, typeof FileInput]>;
7
+ export declare const securityAnalysis: TaintAnalysisDefinition<"security", import("../finite-domain").FiniteDomain<typeof Top, typeof Bottom, [typeof Top, typeof Bottom, typeof UserInput, typeof NetworkInput, typeof FileInput]>, import("../../abstract-interpretation/absint-inference").AbsintVisitorConfiguration>;