Skip to content

disable external entity resolution when parsing aop.xml - #359

Open
nabhan06 wants to merge 1 commit into
eclipse-aspectj:masterfrom
nabhan06:aopxml-external-entities
Open

disable external entity resolution when parsing aop.xml#359
nabhan06 wants to merge 1 commit into
eclipse-aspectj:masterfrom
nabhan06:aopxml-external-entities

Conversation

@nabhan06

Copy link
Copy Markdown

The three setFeature calls in saxParsing use https://xml.org/sax/features/..., but the SAX feature identifiers are http://xml.org/sax/features/..., so each call throws SAXNotRecognizedException and the surrounding catch swallows it. External general and parameter entities are therefore still enabled, and resolveEntity compounds it by returning null for any public id it doesn't recognise, which is how you tell a SAX parser to go fetch the system id itself. An aop.xml picked up from the load-time weaving classpath can then make the weaver read a local file or issue an outbound request, and since an external DTD can declare a default for the aspect name attribute it can also choose which aspect gets woven.

Corrected the feature URIs and changed resolveEntity to hand back an empty source for unknown ids so nothing is fetched even on a parser that ignores those features; the same edit makes the public id comparison null-safe, which previously threw NPE on a SYSTEM-only doctype. Both new cases in DocumentParserTest fail on master and pass here, and the weaver and loadtime suites stay green.

Signed-off-by: sayed nabhan <nabhan@bugqore.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant