We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7806505 commit 026c521Copy full SHA for 026c521
1 file changed
config/config_xml.go
@@ -1,7 +1,6 @@
1
package config
2
3
import (
4
- "bytes"
5
"encoding/xml"
6
)
7
@@ -13,10 +12,7 @@ import (
13
12
// Security: This function uses xml.Decoder with strict settings to prevent
14
// XXE (XML External Entity) attacks.
15
func UnmarshalXML(content []byte, v interface{}) error {
16
- decoder := xml.NewDecoder(bytes.NewReader(content))
17
- // Note: Go's xml package doesn't process external entities by default
18
- // This explicit usage of Decoder provides clarity and future-proofing
19
- return decoder.Decode(v)
+ return xml.Unmarshal(content, v)
20
}
21
22
// MarshalXML returns the XML encoding of v.
0 commit comments