-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[DependencyInjection] force enabling the external XML entity loaders #18915
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@nicolas-grekas @sstok I don't see the security issue here. The |
Edit. OK, that's no problem as the Document is parsed before the validation takes place.
I'm confused here, is the problem still existent or does this pull request solve the issue? And as @nicolas-grekas pointed out it also needs to be done for the XliffFileLoader schema validator also as it loads at least one external resource https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd#L33 (gets replaced by a local version). |
There are other calls to |
@fabpot One place is in the XliffFileLoader which afaik doesn't support to import resources anyway (and thus would not be affected). And forcing the value in the |
Ah no I was mistaken. The |
de5175b
to
d60d4e0
Compare
if (!@$dom->schemaValidateSource($source)) { | ||
throw new InvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s', $file, implode("\n", $this->getXmlErrors($internalErrors)))); | ||
} | ||
|
||
libxml_disable_entity_loader($disableEntities); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to restore the orig value before throwing, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, good catch.
Thank you @xabbuh. |
…ty loaders (xabbuh) This PR was merged into the 2.7 branch. Discussion ---------- [DependencyInjection] force enabling the external XML entity loaders | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18876, #18908 | License | MIT | Doc PR | Commits ------- 12b5509 force enabling the external XML entity loaders
Uh oh!
There was an error while loading. Please reload this page.