Issues

Select view

Select search mode

 

Sending bad XML to the Requisitions ReST end point makes the API unusable

Fixed

Description

Let's say an operator is managing the inventory through the ReST API directly as he is in the process of developing a script to populate the requisitions in OpenNMS.

The following XML is actually a valid content when querying /opennms/rest/nodes,

It is good for that end point, as that is a partial representation of the OnmsNode object. Now, a user might try to use this wrong object against /opennms/rest/requisitions, which is not going to work as that is not a representation of a RequisitionedNode object.

The problem is that the API won't complain and will accept the request:

The above assumes that I've saved the XML on a file called bad-node.xml.

Now, if I try to perform a GET request against the requisitions end point for the requisition in question, it fails and returs an HTTP 500 error.

Checking the logs, I found the problem on the attached web.log.

From now on, the ReST end point for the affected requisition is unusable until opennms is restarted.

I think the ReST end point should validate the XML input and reject it when it is malformed, which is not the case, hence the exception:

 

Acceptance / Success Criteria

None

Attachments

1

Lucidchart Diagrams

Details

Assignee

Reporter

Labels

Components

Sprint

Priority

PagerDuty

Created October 31, 2017 at 8:50 PM
Updated November 7, 2017 at 3:07 PM
Resolved November 7, 2017 at 3:07 PM

Activity

Show:

Benjamin ReedNovember 7, 2017 at 3:07 PM

Merged to foundation-2016

Alejandro GalueOctober 31, 2017 at 9:08 PM

I verified the problem on latest version of Meridian 2016 and Meridian 2017.