Skip to content

Security: Unsanitized XML construction allows label-config injection#803

Open
tomaioo wants to merge 1 commit intoHumanSignal:masterfrom
tomaioo:fix/security/unsanitized-xml-construction-allows-labe
Open

Security: Unsanitized XML construction allows label-config injection#803
tomaioo wants to merge 1 commit intoHumanSignal:masterfrom
tomaioo:fix/security/unsanitized-xml-construction-allows-labe

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented Apr 16, 2026

Summary

Security: Unsanitized XML construction allows label-config injection

Problem

Severity: Medium | File: src/label_studio_sdk/converter/imports/label_config.py:L15

generate_label_config interpolates categories and tags values directly into XML attributes and elements without escaping. If inputs are user-controlled, crafted values can break XML structure or inject malicious markup that may trigger downstream parsing/UI issues.

Solution

Escape XML-sensitive characters for all interpolated values (e.g., via xml.sax.saxutils.escape / quoteattr) or construct XML via a safe XML builder library rather than string replacement.

Changes

  • src/label_studio_sdk/converter/imports/label_config.py (modified)

…ig i

`generate_label_config` interpolates `categories` and `tags` values directly into XML attributes and elements without escaping. If inputs are user-controlled, crafted values can break XML structure or inject malicious markup that may trigger downstream parsing/UI issues.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant