bandit icon indicating copy to clipboard operation
bandit copied to clipboard

S608: false positive SQL injection detected

Open spaceone opened this issue 2 years ago • 4 comments

        print(dedent(
            r"""
            The local repository has been prepared. The repository can be updated using:

              univention-repository-update net

            The local host has been modified to use this local repository.  Other hosts
            must be re-configured by setting the Univention Configuration Registry (UCR)
            variable 'repository/online/server' to the FQDN of this host.

              ucr set repository/online/server="%(hostname)s.%(domainname)s"

            The setting is best set in a domain by defining UCR Policies, which
            set this variable on all hosts using this repository server. For example:

              udm policies/repositoryserver create \
                --position "cn=repository,cn=update,cn=policies,%(ldap/base)s" \
                --set name="%(hostname)s repository" \
                --set repositoryServer="%(hostname)s.%(domainname)s"
              udm container/dc modify \
                --dn "%(ldap/base)s" \
                --policy-reference "cn=%(hostname)s repository,cn=repository,cn=update,cn=policies,%(ldap/base)s"
            """ % configRegistry))

is detected false positively as S608.

spaceone avatar Feb 10 '23 18:02 spaceone

another false-positive raise Exception(f"Select a valid asset from {', '.join(ASSETS)}") from https://github.com/charliermarsh/ruff/issues/2854

spaceone avatar Feb 13 '23 14:02 spaceone

Got a false positive for this: LOG.info(f"Failed to delete {log_name} from Redis.", **log_kwargs)

ska-kialo avatar Jun 15 '23 10:06 ska-kialo

I've the same issue, quite annoying... I've to skip that check temporary. Any news about a potential fix ?

jlejeune avatar Sep 07 '23 07:09 jlejeune

This rule is triggered for simple strings that have ' and \n like

"Foo bar 'some_text/' spameggs.\n"

This rule is rather annoying than useful because of many false positives. I always had to disable it my projects.

Maybe it must be "opt-in" (instead of "opt-out") if it is too hard to reduce false positives.

simon-liebehenschel avatar Nov 01 '23 08:11 simon-liebehenschel