Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
fabpot merged 1 commit intosymfony:2.7fromxabbuh:issue-18876
Jun 13, 2016

Conversation

@xabbuh
Copy link
Member

@xabbuhxabbuh commentedMay 30, 2016
edited by nicolas-grekas
Loading

QA
Branch?2.7
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#18876,#18908
LicenseMIT
Doc PR

@xabbuh
Copy link
MemberAuthor

@nicolas-grekas@sstok I don't see the security issue here. TheXmlUltils class still disables the entity loaders and switches the setting back to the old value after documents have been processed. The only place where we did not take into account whether the entity loaders are disabled are the validation of DI extension config files (which currently implicitly assumes that loaders are not disabled).

@sstok
Copy link
Contributor

sstok commentedMay 30, 2016
edited
Loading

What I mean is willschemaValidateSource() load any external resources of the source or will it parse the source as-is? And if it will load external resources, are then any security risks with that (including DoS attacks).

Edit. OK, that's no problem as the Document is parsed before the validation takes place.
So the parser should warn about that, only when a schema loads external resources it can be a problem, but who is crazy enough to load schema's from an untrusted source 😄

The only place where we did not take into account whether the entity loaders are disabled are the validation of DI extension config files (which currently implicitly assumes that loaders are not disabled).

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 resourcehttps://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).

@fabpot
Copy link
Member

There are other calls toschemaValidateSource in some other components, do we also need to make the same change?

@xabbuh
Copy link
MemberAuthor

@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 theXmlUtils does not sound like a good idea to me as we do not know how people use that class and imo they should force the proper value themselves if necessary.

@xabbuh
Copy link
MemberAuthor

Ah no I was mistaken. TheXliffFileLoader needs to be updated as well.

@xabbuhxabbuhforce-pushed theissue-18876 branch 2 times, most recently fromde5175b tod60d4e0CompareJune 9, 2016 11:45
thrownewInvalidResourceException(sprintf('Invalid resource provided: "%s"; Errors: %s',$file,implode("\n",$this->getXmlErrors($internalErrors))));
}

libxml_disable_entity_loader($disableEntities);

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?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Sure, good catch.

@fabpot
Copy link
Member

Thank you@xabbuh.

@fabpotfabpot merged commit12b5509 intosymfony:2.7Jun 13, 2016
fabpot added a commit that referenced this pull requestJun 13, 2016
…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
@xabbuhxabbuh deleted the issue-18876 branchJune 13, 2016 06:32
@fabpotfabpot mentioned this pull requestJun 15, 2016
This was referencedJun 30, 2016
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

5 participants

@xabbuh@sstok@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp