Skip to content

Xml-crypto doesnt properly handle dtd #524

@bawolff

Description

@bawolff

Xml-crypto uses xmldom to parse xml. Xmldom does not support dtd, however dtds can affect the meaning of the document.

For example:

<foo>&amp;:bar;</foo>

And

<!DOCTYPE foo [<!ENTITY :bar "admin">]>
<foo>&:bar;</foo>

Have different meanings and different canonical forms. xml-crypto should give these documents different hashes and different digital signatures. However it thinks they are the same.

This is not a huge deal in practise as most downstream users also use xmldom. However it could be a big deal if a downstream user was parsing documents with something more compliant with the xml spec like happydom

Suggested fix: just error if the doc has a dtd, its an obscure feature nobody uses. If that is too restrictive (some people add them as document identifiers) error on dtds containing an internal subset.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions