Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 533287

Summary: CMSServlet.outputXML() does not escape strings
Product: [Retired] Dogtag Certificate System Reporter: John Dennis <jdennis>
Component: Certificate ManagerAssignee: RHCS Maintainers <rhcs-maint>
Status: CLOSED EOL QA Contact: Ben Levenson <benl>
Severity: medium Docs Contact:
Priority: low    
Version: 1.2CC: dpal, jgalipea, rcritten
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 20:00:21 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 531953    
Bug Blocks: 431020, 431022, 533979    

Description John Dennis 2009-11-05 21:46:42 UTC
When generating XML it's important to escape (e.g. replace with entities) all strings. This is important for two reasons:

1) to produce valid XML
2) to protect against injection attacks

The best way to produce valid and safe XML is to build a DOM tree and serialize it. In fact many parts of CMS do this via the XMLObject class. However, for some reason CMSServlet.outputXML just uses println() in a naive fashion.

By the way, I've filed a number of bugs in the last couple of days. I've got patches for many of them and I'll attach the patches to the bug reports shortly.

Comment 1 John Dennis 2009-11-12 16:26:23 UTC
patch provided in bz #531953 solves this problem

Comment 2 Andrew Wnuk 2009-11-25 23:46:26 UTC
Patch included in in bug #533979 (attachment #373874 [details]) is committed.