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

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

Closed
DemiMarie opened this issue Jul 11, 2024 · 2 comments
Closed

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

DemiMarie opened this issue Jul 11, 2024 · 2 comments
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@DemiMarie
Copy link
Contributor

DemiMarie commented Jul 11, 2024

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.

@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 13, 2024
DemiMarie added a commit to DemiMarie/go that referenced this issue Sep 1, 2024
This is permitted by the XML specification.

Fixes: golang#68387
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/610056 mentions this issue: encoding/xml: allow ]]> in attribute values

DemiMarie added a commit to DemiMarie/go that referenced this issue Sep 3, 2024
This is permitted by the XML specification.

Fixes: golang#68387
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 4, 2024
@dmitshur dmitshur added this to the Go1.24 milestone Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants