mraible opened a new pull request, #263:
URL: https://github.com/apache/roller/pull/263
Apache XML-RPC is end of life. 3.1.3, its last release, has an unfixed
denial-of-service issue (CVE-2016-5004, the open Dependabot alert). Roller's
servlet layer was already a fork, because `xmlrpc-server` has no Jakarta
release. One concrete problem in that fork: it inflated gzip-encoded request
bodies with no limit.
This replaces the library with a small server in `webservices/xmlrpc`.
Clients see the same methods, faults and fault codes.
- **`XmlRpcRequestParser`**:
- parses with `SafeSAXBuilder`, so DOCTYPEs are refused and nothing is
resolved;
- accepts only the specification's types (string, int/i4, boolean, double,
dateTime.iso8601, base64, struct, array) and caps nesting at 32;
- turns structs into Maps and arrays into `Object[]` as before, so the
handlers' casts are unchanged;
- reads dates in the spec's `yyyyMMddTHH:mm:ss` form, plus the dashed,
fractional and zoned variants clients send.
- **`XmlRpcResponseWriter`**:
- writes UTF-8 `methodResponse` and fault documents, with dates in the old
format and the server's zone;
- escapes markup and drops characters XML 1.0 forbids. That filter now
lives in `util/XmlCharacters`, and `AtomWriter` uses the same one.
- **`XmlRpcServer`**:
- exposes each handler's public, non-void methods, inherited ones
included, as `prefix.method`, like the library's property mapping. So
`metaWeblog.getUsersBlogs` still works.
- picks the overload whose parameter types fit, so the `int`/`boolean
publish` pairs still work;
- passes handler faults through with their codes. Any other failure is
logged and answered with fault 1000, so internal messages stay on the server.
- **`RollerXmlRpcServlet`**:
- caps the request at 1 MiB, or while uploads are on, at the largest
allowed upload as (line-wrapped) base64 plus 64 KiB;
- answers 413 above that, and applies the cap to the decompressed size of
a gzip body;
- answers 415 for other content encodings and 400 for broken gzip.
Removed: `xmlrpc-common`, `xmlrpc-server`, `ws-commons-util`, the forked
`RollerXmlRpcServletServer`, `XmlRpcServlet.properties`, the
`enabledForExtensions` init-param and `SecureXmlParsers.installForXmlRpc()`.
The handlers now throw Roller's own `XmlRpcException` and
`XmlRpcNotAuthorizedException`.
Tests:
- `XmlRpcServerTest`: dispatch, overloads, inherited methods, struct and
array conversion, faults, no leaked internals, and that every Blogger and
MetaWeblog name is registered.
- `XmlRpcResponseWriterTest`: types, dates, escaping, well-formed output and
faults.
- `RollerXmlRpcServletTest`: both size checks, gzip accepted, a gzip body
small on the wire but far over the cap decompressed, bad encodings, and the
upload-based cap.
- `XmlRpcExtensionTypeTest`: now runs against the new parser.
- `XMLRPCWeblogPermissionTest`: passes with only its imports changed.
- `mvn install`: 684 tests pass.
I haven't tested this with a desktop blogging client against a running
server. That would be a good check before the RC.
--
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]