Opened 14 years ago

Last modified 14 years ago

#298 new defect

Loading a bad xml file (as template) in IE results in "Access Denied" error.

Reported by: justinrowles Owned by: geonetwork-devel@…
Priority: major Milestone: v2.6.5
Component: General Version: v2.6.0RC0
Keywords: Cc:

Description

If an IE user attempts to load a badly formed xml file as a template, they will not see the SAX parse error, but instead see an 'error on page'. If they open the error, it is an 'Access Denied' error.

This is because the server returns a 500 error along with the exception message. IE decides not to show the exception, but to load its own 500 message from file. Then it notices that the source for the parent page is the GeoNetwork server, but the source for the iframe is the local disk, and triggers its own cross-site scripting defences!

Attachments (1)

xmlremove500errors.patch (5.7 KB ) - added by justinrowles 14 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 by justinrowles, 14 years ago

I would argue that the server should not be returning a 500 error. There has not been an internal error.

A normal 200 response with the correct error message should be the result.

This is not, it appears, how GeoNetwork has been designed. There is no obvious facility to return a message without throwing an exception up to Jetty and thus returning a 500. If anyone can show me how that is intended to be done, then I will provide a patch.

comment:2 by ticheler, 14 years ago

Milestone: v2.6.0v2.6.1

comment:3 by heikki, 14 years ago

Milestone: v2.6.1v2.6.2

comment:4 by justinrowles, 14 years ago

Milestone: v2.6.3v2.6.5

I've done this, patch attached.

There are three reasons we might fail:

  • internal server error (don't catch exception, returns 500)
  • invalid xml (catch exception, return 200 + error message via new xlst)
  • xml is not schema valid (catch exception, return 200 + error message via new xlst)

The patch is against trunk at time of writing, which is almost 2.6.4. It should patch in without issues immediately after 2.6.4 is released.

by justinrowles, 14 years ago

Attachment: xmlremove500errors.patch added
Note: See TracTickets for help on using tickets.