Skip to content
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

XMLSecurityDSig->validateReference() Null Exception #108

Closed
ermalmino opened this issue Aug 16, 2016 · 3 comments
Closed

XMLSecurityDSig->validateReference() Null Exception #108

ermalmino opened this issue Aug 16, 2016 · 3 comments

Comments

@ermalmino
Copy link

ermalmino commented Aug 16, 2016

Hello,

We have been using your library as part of LightSaml and with a particular Identity Provider's response there was a Null pointer exception occuring inside XMLSecurityDSig->validateReference() function,
more specifically at this line:

if (! $docElem->isSameNode($this->sigNode)) {
$this->sigNode->parentNode->removeChild($this->sigNode);
}

Aparently $this->sigNode->parentNode is null and a simple check was enough to solve the problem for me, like this:

if (! $docElem->isSameNode($this->sigNode)) {
if($this->sigNode->parentNode != null) {
$this->sigNode->parentNode->removeChild($this->sigNode);
}
}

I would appreciate if you could fix this.
Let me know if I can provide more info on the matter.

Thank you for your great library,
Ermal.

@tmilos
Copy link
Contributor

tmilos commented Aug 17, 2016

As mentioned in lightSAML/SpBundle#15 (comment) ... Think the solution should be determined once we're able to reproduce the error... So, please provide how to reproduce the error, with all needed data. Maybe the error is in lightsaml and not here in xmlseclibs...

@tmilos
Copy link
Contributor

tmilos commented Nov 2, 2016

This is happening if one same instance of signature is verified for the second time (with different key). Problem is dom is modified and implementation does not expect side effects itself have made. Have tried suggested fix by @ermalmino and it prevents for erroring on the second verificaction.

tmilos added a commit to tmilos/xmlseclibs that referenced this issue Nov 2, 2016
@tmilos
Copy link
Contributor

tmilos commented Nov 2, 2016

Made fix in #113 ... waiting to be merged

@tmilos tmilos mentioned this issue Nov 3, 2016
robrichards added a commit that referenced this issue Mar 9, 2017
allow validation multiple times #108
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

No branches or pull requests

3 participants