Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to check argument value with regex? #120

Open
IgorInk opened this issue Feb 24, 2023 · 1 comment
Open

How to check argument value with regex? #120

IgorInk opened this issue Feb 24, 2023 · 1 comment

Comments

@IgorInk
Copy link

IgorInk commented Feb 24, 2023

Hi. How can I check some argument value with mariana?
For example, I need to check Cipher.getInstanse(v) argument value with some regex pattern (AES/CBC/* etc)
I'm defining this model for sink:

      "find": "methods",
      "where": [
        {
          "constraint": "is_static",
          "value": true
        },
        {
          "constraint": "signature",
          "pattern": "Ljavax/crypto/Cipher;\\.getInstance:\\(Ljava/lang/String;\\)Ljavax/crypto/Cipher;"
        }
      ],
      "model": {
        "for_all_parameters": [
          {
            "variable": "idx",
            "where": [

            ],
            "sinks": [
              {
                "kind": "CryptoTransformation",
                "port": "Argument(0)",
                "via_value_of": [
                  "Argument(0)"
                ]
              }
            ]
          }
        ]
      }

How can I check Argument(0) value with the regex?
Thanks

@arthaud
Copy link
Contributor

arthaud commented Feb 24, 2023

Hi @IgorInk,

This is not currently possible and is unlikely to be implemented soon. The model generation step (which parses the json) does not have information about arguments, it only has typing information.
I would recommend using via_value_of for now (as you did).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants