Project

General

Custom queries

Profile

Actions

Architecture #3972

open

Scala XML library accepts invalid XML characters

Added by Vincent MEMBRÉ over 11 years ago. Updated over 4 years ago.

Status:
New
Priority:
N/A
Category:
Architecture - Code maintenance
Target version:
-
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>
                   ^
scala> val s = <xml>{"a \rb"}</xml>
b</xml>a.xml.Elem = <xml>a 
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


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #3967: Change request cannot be accepted: multiline text cause merge incompatibilityReleasedFrançois ARMAND2013-09-26Actions
Actions #4

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

Actions #13

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 :(

Actions #39

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.

Actions #61

Updated by Nicolas CHARLES almost 6 years ago

  • Target version changed from 588 to 5.0.13

certainly still true

Actions

Also available in: Atom PDF