@@ -50,34 +50,31 @@ predicate isCreatingAzureClientSideEncryptionObjectNewVersion(Call call, Class c
50
50
/**
51
51
* A dataflow config that tracks `EncryptedBlobClientBuilder.version` argument initialization.
52
52
*/
53
- private class EncryptedBlobClientBuilderSafeEncryptionVersionConfig extends DataFlow:: Configuration {
54
- EncryptedBlobClientBuilderSafeEncryptionVersionConfig ( ) {
55
- this = "EncryptedBlobClientBuilderSafeEncryptionVersionConfig"
56
- }
57
-
58
- override predicate isSource ( DataFlow:: Node source ) {
53
+ private module EncryptedBlobClientBuilderSafeEncryptionVersionConfig implements DataFlow:: ConfigSig {
54
+ predicate isSource ( DataFlow:: Node source ) {
59
55
exists ( FieldRead fr , Field f | fr = source .asExpr ( ) |
60
56
f .getAnAccess ( ) = fr and
61
57
f .hasQualifiedName ( "com.azure.storage.blob.specialized.cryptography" , "EncryptionVersion" ,
62
58
"V2" )
63
59
)
64
60
}
65
61
66
- override predicate isSink ( DataFlow:: Node sink ) {
62
+ predicate isSink ( DataFlow:: Node sink ) {
67
63
isCreatingAzureClientSideEncryptionObjectNewVersion ( _, _, sink .asExpr ( ) )
68
64
}
69
65
}
70
66
67
+ private module EncryptedBlobClientBuilderSafeEncryptionVersionFlow =
68
+ DataFlow:: Global< EncryptedBlobClientBuilderSafeEncryptionVersionConfig > ;
69
+
71
70
/**
72
71
* Holds if `call` is an object creation for a class `EncryptedBlobClientBuilder`
73
72
* that takes `versionArg` as the argument specifying the encryption version, and that version is safe.
74
73
*/
75
74
predicate isCreatingSafeAzureClientSideEncryptionObject ( Call call , Class c , Expr versionArg ) {
76
75
isCreatingAzureClientSideEncryptionObjectNewVersion ( call , c , versionArg ) and
77
- exists ( EncryptedBlobClientBuilderSafeEncryptionVersionConfig config , DataFlow:: Node sink |
78
- sink .asExpr ( ) = versionArg
79
- |
80
- config .hasFlow ( _, sink )
76
+ exists ( DataFlow:: Node sink | sink .asExpr ( ) = versionArg |
77
+ EncryptedBlobClientBuilderSafeEncryptionVersionFlow:: flowTo ( sink )
81
78
)
82
79
}
83
80
0 commit comments