Skip to content

restrict SourcesPage to resources of the page's own package#1523

Open
fr-manvi wants to merge 1 commit into
apache:masterfrom
fr-manvi:sources-page-package-scope
Open

restrict SourcesPage to resources of the page's own package#1523
fr-manvi wants to merge 1 commit into
apache:masterfrom
fr-manvi:sources-page-package-scope

Conversation

@fr-manvi

Copy link
Copy Markdown

The source page parameter of the examples source browser goes straight into Class.getResourceAsStream(), so it is not limited to the package it claims to show:

  • ?SourcesPage_class=org.apache.wicket.examples.helloworld.HelloWorld&source=/META-INF/NOTICE returns any class path resource, absolute names included
  • source=../style.css walks out of the package the same way
  • .class files are readable too, although the file browser deliberately filters them out

The page already computes the list of files it is willing to show, so the requested name is now checked against that list. Building the list also had to stop looking at only the first class path entry of the package, otherwise a package present in more than one entry loses files it should offer.

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