coheigea commented on code in PR #3512:
URL: https://github.com/apache/cxf/pull/3512#discussion_r4122508135
##########
core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java:
##########
@@ -555,7 +574,9 @@ private static Schema createSchema(ServiceInfo serviceInfo,
Bus b) {
if (resolver.getInputStream() == null) {
sch.write(out);
} else {
-
IOUtils.copyAndCloseInput(resolver.getInputStream(), out);
+ // Re-parse securely rather than copying the
raw bytes, so that any
+ // DTD in the fetched document never reaches
the SchemaFactory
+
out.write(toSecureBytes(resolver.getInputStream(), sch.getSourceURI()));
Review Comment:
he stream is owned by the URIResolver in the enclosing try-with-resources;
URIResolver.close() closes it, so wrapping it again would close it twice.
##########
core/src/main/java/org/apache/cxf/ws/addressing/EndpointReferenceUtils.java:
##########
@@ -555,7 +574,9 @@ private static Schema createSchema(ServiceInfo serviceInfo,
Bus b) {
if (resolver.getInputStream() == null) {
sch.write(out);
} else {
-
IOUtils.copyAndCloseInput(resolver.getInputStream(), out);
+ // Re-parse securely rather than copying the
raw bytes, so that any
+ // DTD in the fetched document never reaches
the SchemaFactory
+
out.write(toSecureBytes(resolver.getInputStream(), sch.getSourceURI()));
Review Comment:
The stream is owned by the URIResolver in the enclosing try-with-resources;
URIResolver.close() closes it, so wrapping it again would close it twice.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]