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: allows a colon before or after an XML name #68294

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

encoding/xml: allows a colon before or after an XML name #68294

DemiMarie opened this issue Jul 4, 2024 · 5 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.
Milestone

Comments

@DemiMarie
Copy link
Contributor

DemiMarie commented Jul 4, 2024

Go version

go version go1.21.11 linux/amd64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/home/user/.cache/go-build'
GOENV='/home/user/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/user/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='linux'
GOPATH='/home/user/go'
GOPRIVATE=''
GOPROXY='direct'
GOROOT='/usr/lib/golang'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/usr/lib/golang/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.21.11'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/dev/null'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3671854511=/tmp/go-build -gno-record-gcc-switches'

What did you do?

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

What did you see happen?

xml.Unmarshal accepts <:a/>, <a:/>, <a :b="c"/>, and <a b:="c"/>.

What did you expect to see?

xml.Unmarshal should return an error because <:a/>, <a:/>, <a :b="c"/>, and <a b:="c"/> are all ill-formed XML. An XML name must not start or end with a colon.

@DemiMarie DemiMarie changed the title encoding/xml: allows a colon before an XML entity name encoding/xml: allows a colon before or after an XML name Jul 4, 2024
@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 8, 2024
@cagedmantis cagedmantis added this to the Backlog milestone Jul 8, 2024
@cagedmantis
Copy link
Contributor

@rsc

@cagedmantis
Copy link
Contributor

Please note this related comment #68293 (comment)

@DemiMarie
Copy link
Contributor Author

Please note this related comment #68293 (comment)

#68299 is that proposal

@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