@@ -114,8 +114,9 @@ module Path {
114114 * is intended to include deserialization, unmarshalling, decoding, unpickling,
115115 * decompressing, decrypting, parsing etc.
116116 *
117- * Doing so should normally preserve taint, but it can also be a problem
118- * in itself, e.g. if it allows code execution or could result in denial-of-service.
117+ * A decoding (automatically) preserves taint from input to output. However, it can
118+ * also be a problem in itself, for example if it allows code execution or could result
119+ * in denial-of-service.
119120 *
120121 * Extend this class to refine existing API models. If you want to model new APIs,
121122 * extend `Decoding::Range` instead.
@@ -145,8 +146,9 @@ module Decoding {
145146 * is intended to include deserialization, unmarshalling, decoding, unpickling,
146147 * decompressing, decrypting, parsing etc.
147148 *
148- * Doing so should normally preserve taint, but it can also be a problem
149- * in itself, e.g. if it allows code execution or could result in denial-of-service.
149+ * A decoding (automatically) preserves taint from input to output. However, it can
150+ * also be a problem in itself, for example if it allows code execution or could result
151+ * in denial-of-service.
150152 *
151153 * Extend this class to model new APIs. If you want to refine existing API models,
152154 * extend `Decoding` instead.
@@ -166,12 +168,21 @@ module Decoding {
166168 }
167169}
168170
171+ private class DecodingAdditionalTaintStep extends TaintTracking:: AdditionalTaintStep {
172+ override predicate step ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
173+ exists ( Decoding decoding |
174+ nodeFrom = decoding .getAnInput ( ) and
175+ nodeTo = decoding .getOutput ( )
176+ )
177+ }
178+ }
179+
169180/**
170181 * A data-flow node that encodes data to a binary or textual format. This
171182 * is intended to include serialization, marshalling, encoding, pickling,
172183 * compressing, encrypting, etc.
173184 *
174- * Doing so should normally preserve taint.
185+ * An encoding (automatically) preserves taint from input to output .
175186 *
176187 * Extend this class to refine existing API models. If you want to model new APIs,
177188 * extend `Encoding::Range` instead.
@@ -198,7 +209,7 @@ module Encoding {
198209 * is intended to include serialization, marshalling, encoding, pickling,
199210 * compressing, encrypting, etc.
200211 *
201- * Doing so should normally preserve taint.
212+ * An encoding (automatically) preserves taint from input to output .
202213 *
203214 * Extend this class to model new APIs. If you want to refine existing API models,
204215 * extend `Encoding` instead.
@@ -215,6 +226,15 @@ module Encoding {
215226 }
216227}
217228
229+ private class EncodingAdditionalTaintStep extends TaintTracking:: AdditionalTaintStep {
230+ override predicate step ( DataFlow:: Node nodeFrom , DataFlow:: Node nodeTo ) {
231+ exists ( Encoding encoding |
232+ nodeFrom = encoding .getAnInput ( ) and
233+ nodeTo = encoding .getOutput ( )
234+ )
235+ }
236+ }
237+
218238/**
219239 * A data-flow node that dynamically executes Python code.
220240 *
0 commit comments