Skip to content

Conversation

@vl43den
Copy link
Contributor

@vl43den vl43den commented Jan 8, 2026

When using ConvertTypeTransformation(target_type="str") with EQL backend + ecs_windows pipeline, trailing backslashes before wildcards aren't escaped correctly.

Image|contains: '\Desktop\'
  • Bug: "*\\Desktop\*" - trailing \ escapes the *
  • Expected: "*\\Desktop\\*" - both backslashes escaped

Reason:
Tracing the pipeline leads to "ConvertTypeTransformation" -> apply_value() calls SigmaString(str(val)) which re-parses the string. The trailing backslash is then interpreted as escaping the wildcard added by the modifier.

This effect can be avoided by returning SigmaString values unchanged instead of re-parsing:

if isinstance(val, SigmaString):
    return val

Testing

  • pySigma-backend-elasticsearch: 38 passed
  • pySigma transformations: 139 passed

Related

Fixes #431, pySigma-backend-elasticsearch#167

Optimized value conversion to SigmaString by avoiding re-parsing existing SigmaString entries
@thomaspatzke thomaspatzke merged commit 477efc5 into SigmaHQ:main Jan 8, 2026
20 checks passed
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

Successfully merging this pull request may close these issues.

Trailing backslashes escape wildcards added by modifiers

2 participants