Skip to content

decode_evasion: base64 not decoded (percent / HTML-entity / hex are) — intended? #42

Description

decode_evasion() unwraps several encodings but not base64:

import navi_sanitize as ns
ns.decode_evasion("%69%67%6e%6f%72%65")       # -> "ignore"   (percent)
ns.decode_evasion("ignore")          # -> "ignore"   (HTML entities)
ns.decode_evasion("\\x69\\x67nore")            # -> "ignore"   (hex escapes)
ns.decode_evasion("aWdub3JlIGFsbCBydWxlcw==")  # -> unchanged  (base64)

Is base64 intentionally excluded — presumably to avoid mangling legitimate base64-looking text, consistent with the "legitimate input preserved" goal? If so, a one-line note in the decode_evasion docstring/docs would set expectations. If it's a gap, consider an opt-in layer (e.g. decode_evasion(text, base64=True)) for contexts where base64 payloads are an expected evasion vector.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions