8000 `// mobsf-ignore: ios_log` comment does not work in .swift files · Issue #107 · MobSF/mobsfscan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

// mobsf-ignore: ios_log comment does not work in .swift files #107

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

Open
yanz-safe opened this issue Feb 3, 2025 · 0 comments
Open

// mobsf-ignore: ios_log comment does not work in .swift files #107

yanz-safe opened this issue Feb 3, 2025 · 0 comments

Comments

@yanz-safe
Copy link
Contributor
yanz-safe commented Feb 3, 2025

My code looks like

        if isRunningPreviews {
            Swift.print(content)  // mobsf-ignore: ios_log
        }

But scaning still generates violation

{
          "message": {
            "text": "The App logs information. Sensitive information should never be logged."
          },
          "level": "note",
          "locations": [
            {
              "physicalLocation": {
                "region": {
                  "snippet": {
                    "text": "print("
                  },
                  "endColumn": 2457,
                  "endLine": 71,
                  "startColumn": 2451,
                  "startLine": 71
                },
                "artifactLocation": {
                  "uri": "App/.../Util.swift"
                }
              }
            }
          ],
          "properties": {
            "owasp-mobile": "M1: Improper Platform Usage",
            "masvs": "MSTG-STORAGE-3",
            "cwe": "CWE-532: Insertion of Sensitive Information into Log File",
            "reference": "https://github.com/MobSF/owasp-mstg/blob/master/Document/0x06i-Testing-Code-Quality-and-Build-Settings.md#finding-debugging-code-and-verbose-error-logging-mstg-code-4"
          },
          "ruleId": "ios_log",
          "ruleIndex": 0
        },

How can I silence this violation for specific lines of code with ios_log violations

Other rules are correctly ignored:

            configuration.tlsMinimumSupportedProtocolVersion = .TLSv13  // mobsf-ignore: ios_depr_tls_min
extension Int {
    @inlinable public static func insecureRandom(in range: ClosedRange<Int>) -> Int {
        Int.random(in: range)  // mobsf-ignore: ios_insecure_random_no_generator
    }
    @inlinable public static func insecureRandom(in range: Range<Int>) -> Int {
        Int.random(in: range)  // mobsf-ignore: ios_insecure_random_no_generator
    }
}

Thank you!

@yanz-safe yanz-safe changed the title mobsf-ignore comment does not work in .swift files // mobsf-ignore: ios_log comment does not work in .swift files Feb 3, 2025
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

1 participant
0