Fix XSS in section handling

Bug: 65042
Change-Id: Ic52f9889d6f122329d50ccbdd73d5303b084773a
(cherry picked from commit 78f85803f64ae3ecedbecb38473ee70606fca5c9)