Bug 1143658 - AUDIT-FIND: obs-service-tar_scm: XML injection
Summary: AUDIT-FIND: obs-service-tar_scm: XML injection
Status: NEW
Alias: None
Product: SUSE Security Incidents
Classification: Novell Products
Component: Audits (show other bugs)
Version: unspecified
Hardware: Other Other
: P5 - None : Minor
Target Milestone: ---
Assignee: Adrian Schröter
QA Contact: Security Team bot
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 1119444
  Show dependency treegraph
 
Reported: 2019-07-31 14:18 UTC by Malte Kraus
Modified: 2022-02-24 09:52 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Malte Kraus 2019-07-31 14:18:30 UTC
The XML is concatenated from strings, that looks like it allows XML injection - the URL is from untrusted input (the _service file), so it needs to be escaped properly
Comment 1 Johannes Segitz 2020-11-26 16:03:20 UTC
To add a bit more context here: Malte probably meant this in TarSCM/changes.py
126         if service is None:
127             service = ET.fromstring("""\
128               <service name="tar_scm">
129                 <param name="url">%s</param>
130               </service>
131             """ % url)
132             root.append(service)
133             write_servicedata = True

but this class parses the _service file, which can be used directly to inject malicious XML.
 73             return ET.parse(servicedata_file, parser=xml_parser)

a good description of what is possible with this:
https://pypi.org/project/defusedxml/

In this uses case I see this as a hardening mostly. Because of that I'll reduce the severity. Tracked in https://github.com/openSUSE/obs-service-tar_scm/issues/382 for visibility
Comment 2 Johannes Segitz 2022-02-24 09:45:25 UTC
this is still valid and unfixed
Comment 3 Adrian Schröter 2022-02-24 09:52:38 UTC
the network protection is handled in the network setup of build.opensuse.org server.
Not sure how any generic filtering of host names would look alike...