Actions
Architecture #3972
openScala XML library accepts invalid XML characters
Status:
New
Priority:
N/A
Assignee:
Category:
Architecture - Code maintenance
Target version:
-
Pull Request:
Effort required:
Name check:
Fix check:
Regression:
Description
Following #3967, We found out that Scala XML library has some issue with some particular character:
- it correctly refuse invalid characters, throwing an error both when serializing and loading it
val s = <xml>{\u000B}</xml> <console>:1: error: illegal character '\u000b' val s = <xml>{\u000B}</xml> ^
- but there is issue with control characters (\r ...)
- it is some valid xml http://www.w3.org/TR/xml/#charsets
- correctly accepted withn scala xml
scala> val s = <xml>{"a \rb"}</xml> b</xml>a.xml.Elem = <xml>a
- replaced by \n when using loaded from a file (which is an accepted behavior :see first note here: www.w3.org/TR/xml/#sec-common-syn):
scala> val is = new ByteArrayInputStream(s.toString.getBytes) is: java.io.ByteArrayInputStream = java.io.ByteArrayInputStream@f608fcd scala> XML.load(is) res13: scala.xml.Elem = <xml>a b</xml>
- causing a difference between the initial xml and the one read
scala> res13 == s res14: Boolean = false
This is causing some issue to us: datas missing in xml, non valid change requests, various security issues...
There is three places in Rudder that serialize dtas into xml:
- Change request (various bug detected, due to comparison between postgres and LDAP datas)
- Events logs
- archive/rollback/datas stored in configuration repository
Updated by Vincent MEMBRÉ over 11 years ago
- Target version changed from 2.4.13 to 2.6.11
Since version 2.4 is not maintained anymore, retargeting to branch 2.6
Updated by François ARMAND over 10 years ago
- Target version changed from 2.6.20 to 2.10.10
Still no good solution for that one :(
Updated by François ARMAND about 8 years ago
- Tracker changed from Bug to Architecture
There is no direct bug for that one (the bug is #3967). So I'm changing that to "architecture", and we will open bug if (when) something impacting user is found.
Updated by Nicolas CHARLES almost 6 years ago
- Target version changed from 588 to 5.0.13
certainly still true
Actions