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: does not reject colons in processing instruction targets #68393

Open
Tracked by #68293
DemiMarie opened this issue Jul 11, 2024 · 2 comments · May be fixed by #69196
Open
Tracked by #68293

encoding/xml: does not reject colons in processing instruction targets #68393

DemiMarie opened this issue Jul 11, 2024 · 2 comments · May be fixed by #69196
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@DemiMarie
Copy link
Contributor

Go version

1.22

Output of go env in your module/workspace:

What is on https://go.dev/play as of when this issue is filed

What did you do?

Ran this Go code:

package main

import (
	"encoding/xml"
	"fmt"
)

func main() {
	err := xml.Unmarshal([]byte(`<?a:b?><a/>`), new(interface{}))
	if err != nil {
		fmt.Printf("XML correctly rejected with error %#v", err)
	} else {
		fmt.Println("No error?")
	}
}

What did you see happen?

No error? output, indicating that unmarshalling was successful.

What did you expect to see?

An error because processing instruction targets cannot contain colons in a namespace-well-formed document.

@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
An XML QName is syntactically two Names separated by a colon, rather
than a single name that has a colon in it.  This fixes multiple bugs in
XML QName reading.

Fixes: golang#68294
Fixes: golang#68392
Fixes: golang#68393
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/609377 mentions this issue: encoding/xml: treat a namespaced name as two names, not one

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants