@@ -15,6 +15,18 @@ import semmle.go.frameworks.stdlib.CompressZlib
1515import semmle.go.frameworks.stdlib.Mime
1616import semmle.go.frameworks.stdlib.MimeMultipart
1717import semmle.go.frameworks.stdlib.MimeQuotedprintable
18+ import semmle.go.frameworks.stdlib.Encoding
19+ import semmle.go.frameworks.stdlib.EncodingAscii85
20+ import semmle.go.frameworks.stdlib.EncodingAsn1
21+ import semmle.go.frameworks.stdlib.EncodingBase32
22+ import semmle.go.frameworks.stdlib.EncodingBase64
23+ import semmle.go.frameworks.stdlib.EncodingBinary
24+ import semmle.go.frameworks.stdlib.EncodingCsv
25+ import semmle.go.frameworks.stdlib.EncodingGob
26+ import semmle.go.frameworks.stdlib.EncodingHex
27+ import semmle.go.frameworks.stdlib.EncodingJson
28+ import semmle.go.frameworks.stdlib.EncodingPem
29+ import semmle.go.frameworks.stdlib.EncodingXml
1830import semmle.go.frameworks.stdlib.Path
1931import semmle.go.frameworks.stdlib.PathFilepath
2032import semmle.go.frameworks.stdlib.Reflect
@@ -697,53 +709,6 @@ module Log {
697709 }
698710}
699711
700- /** Provides models of some functions in the `encoding/json` package. */
701- module EncodingJson {
702- /** The `Marshal` or `MarshalIndent` function in the `encoding/json` package. */
703- class MarshalFunction extends TaintTracking:: FunctionModel , MarshalingFunction:: Range {
704- MarshalFunction ( ) {
705- this .hasQualifiedName ( "encoding/json" , "Marshal" ) or
706- this .hasQualifiedName ( "encoding/json" , "MarshalIndent" )
707- }
708-
709- override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
710- inp = getAnInput ( ) and outp = getOutput ( )
711- }
712-
713- override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
714-
715- override FunctionOutput getOutput ( ) { result .isResult ( 0 ) }
716-
717- override string getFormat ( ) { result = "JSON" }
718- }
719-
720- private class UnmarshalFunction extends TaintTracking:: FunctionModel , UnmarshalingFunction:: Range {
721- UnmarshalFunction ( ) { this .hasQualifiedName ( "encoding/json" , "Unmarshal" ) }
722-
723- override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
724- inp = getAnInput ( ) and outp = getOutput ( )
725- }
726-
727- override FunctionInput getAnInput ( ) { result .isParameter ( 0 ) }
728-
729- override FunctionOutput getOutput ( ) { result .isParameter ( 1 ) }
730-
731- override string getFormat ( ) { result = "JSON" }
732- }
733- }
734-
735- /** Provides models of some functions in the `encoding/hex` package. */
736- module EncodingHex {
737- private class DecodeStringFunction extends TaintTracking:: FunctionModel {
738- DecodeStringFunction ( ) { this .hasQualifiedName ( "encoding/hex" , "DecodeString" ) }
739-
740- override predicate hasTaintFlow ( FunctionInput inp , FunctionOutput outp ) {
741- inp .isParameter ( 0 ) and
742- outp .isResult ( 0 )
743- }
744- }
745- }
746-
747712/** Provides models of some functions in the `crypto/cipher` package. */
748713module CryptoCipher {
749714 private class AeadOpenFunction extends TaintTracking:: FunctionModel , Method {
0 commit comments