You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I know, defusedxml, which this rule suggests as an alternative, does not supply alternative implementations for most of the types, only of some functions. In other words, I have to import types like these for the standard library; there is no defusedxml alternative.
So in order to signal to Ruff that "this is fine"™, I've tried moving the import to TYPE_CHECKING, but still received the same error.
This probably applies to other rules in the S4xx range, too.
The text was updated successfully, but these errors were encountered:
The following code has a similar problem, triggering S409 on the pulldom import, but this time I can't even move the import into a TYPE_CHECKING block:
Again, defusedxml does not provide everything required for parsing XML; here it's the event constant to compare against. Nevertheless I'm using defusedxml for the actual parsing, which means I'm not vulnerable.
scy
added a commit
to AKVorrat/dearmep
that referenced
this issue
Dec 11, 2024
This is a security warning, but I'm only importing types that don't have
a defusedxml alternative anyway. Furthermore, there should be no
warnings in a `TYPE_CHECKING` block. I've opened
<astral-sh/ruff#14901> for this.
Signed-off-by: Tim Weber <[email protected]>
scy
added a commit
to AKVorrat/dearmep
that referenced
this issue
Dec 11, 2024
Again, this is a false positive; `defusedxml` doesn't provide the
constants we import `pulldom` for. Added to the existing issue report at
<astral-sh/ruff#14901 (comment)>.
Signed-off-by: Tim Weber <[email protected]>
The following code triggers S408 ("
xml.dom.minidom
is vulnerable to XML attacks"):As far as I know, defusedxml, which this rule suggests as an alternative, does not supply alternative implementations for most of the types, only of some functions. In other words, I have to import types like these for the standard library; there is no defusedxml alternative.
So in order to signal to Ruff that "this is fine"™, I've tried moving the import to
TYPE_CHECKING
, but still received the same error.This probably applies to other rules in the S4xx range, too.
The text was updated successfully, but these errors were encountered: