Skip to content

encoding/xml: wrongly rejects ]]> in attribute value #68387

@DemiMarie

Description

@DemiMarie

Go version

Whatever https://go.dev/play uses

Output of go env in your module/workspace:

Whatever https://go.dev/play uses

What did you do?

https://go.dev/play/p/cxvESJwGocp

package main

import "encoding/xml"

func main() {
	err := xml.Unmarshal([]byte(`<a b="]]>"/>`), new(interface{}))
	if err != nil {
		panic("well-formed XML rejected")
	}
}

What did you see happen?

encoding/xml rejects an attribute containing ]]>.

What did you expect to see?

encoding/xml should accept attributes containing ]]>, as libxml2 does.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions