id: webview-file-access-fromfileurl-java

info:
  name: Android WebView File Access from file URLs - Detect in Java sources
  author: 7h3b4dger
  severity: info
  description: Android WebView File Access from file URLs enabling was detected - Java source version.
  tags: android,file,webview

file:
  - extensions:
      - java

    matchers-condition: and
    matchers:
      - type: word
        words:
          - "setAllowFileAccessFromFileURLs(true)"

      - type: regex
        part: body
        regex:
          - package\s+(?:.*)

    extractors:
      - type: regex
        part: body
        name: package
        group: 1
        regex:
          - (?m)^\s*package\s+([A-Za-z_][A-Za-z0-9_\.]*)\s*;
# digest: 490a00463044022034c6c89c765c2dc11e557c4b752bd3c7391a8e514f74343f057b87e1a54856b5022062707c1122b2429879a1b3a5bfb6db32bd202a823b826a099335d5fc9cda48ec:922c64590222798bb761d5b6d8e72950