|
1 | 1 | # Improper markup sanitization in popular software
|
2 | 2 |
|
3 |
| -_[Featuring](#affected-software): GitHub, GitLab, {TBA}, Redmine, Gogs, JetBrains, and others._ |
| 3 | +_[Featuring](#affected-software): GitHub, GitLab, Bitbucket, Redmine, Gogs, JetBrains, and others._ |
4 | 4 |
|
5 | 5 | There are several common markup (mostly Markdown) sanitization issues outlined in this article, but I would be mostly speaking about the single, most common one.
|
6 | 6 |
|
@@ -108,16 +108,17 @@ Those already existing event handlers could be used by the attacker to execute s
|
108 | 108 |
|
109 | 109 | I have found and reported markup sanitization related issues in: \
|
110 | 110 | [GitHub](#github), [GitLab](#gitlab),
|
111 |
| - _[TBA](#tba)_, |
| 111 | +[Bitbucket](#bitbucket), |
112 | 112 | [Gogs](#gogs), [Gitea](#gitea), [Redmine](#redmine),
|
113 | 113 | _[TBA 2](#tba-2)_,
|
114 | 114 | [YouTrack](#youtrack),
|
115 | 115 | [Upsource](#upsource),
|
116 | 116 | [JIRA](#jira).
|
117 | 117 |
|
118 |
| -Of those, [TBA](#tba), [TBA 2](#tba-2), [YouTrack](#youtrack), and [Upsource](#upsource) issues are not related to unsanitized `class` atribute. |
119 |
| -Note that the █████ ██████ █████ █████ ███████ ███ █████████████ — █████████ ████ ███ ███████ ████ ██████ ██ ████████ ██████, ███ ███████ ███████ █████████ ██████ |
120 |
| -████████████. ████ ███████ ███████ ████████ ████████████ ████████ ████, though, and ██████ ███ ██████ ███ ████ ██ ██ ████████ ███████ writeup. |
| 118 | +Of those, [Butbucket](#bitbucket), [TBA 2](#tba-2), [YouTrack](#youtrack), and [Upsource](#upsource) issues are not related to unsanitized `class` atribute. |
| 119 | +Note that the first two of those don't satisfy the [prerequisites](#introduction) — Bitbucket does not support HTML markup in Markdown at all, and |
| 120 | +███████ ███████ █████████ ██████ ████████████. |
| 121 | +They managed to fail markup sanitization in other ways, though, and that's the reason for them to be included in this writeup. |
121 | 122 |
|
122 | 123 | See below for the detailed vulnerabilities information, PoC examples and screenshots.
|
123 | 124 |
|
@@ -240,26 +241,57 @@ Redmine (in default setup) has a relatively small number of css rules and a smal
|
240 | 241 |
|
241 | 242 | The severity could be raised in presence of various Redmine plugins that include their own js/css to the page, and installing thirdparty plugins is pretty popular in Redmine ecosystem.
|
242 | 243 |
|
243 |
| -### TBA |
| 244 | +### Bitbucket |
| 245 | + |
| 246 | +_Fixed at: 2017-06-20._ |
244 | 247 |
|
245 | 248 | The issue here is different and is not related to `class` not being sanitized.
|
246 | 249 |
|
247 |
| - |
| 250 | +This is a full-featured XSS, with arbitrary JS code, achievable through issue comments (among other places). |
248 | 251 |
|
249 |
| -This is a full-featured XSS, with arbitrary JS code, achievable through █████████████████████ █████████████. |
| 252 | +PoC 1, covers everything on the page with a div with an `onmouseover` event handler executing arbitrary JS code: |
| 253 | +```md |
| 254 | +The HTML specification is maintained by the W3C. |
| 255 | +*[HTML]: [Hyper Text Markup Language](http://example.com/bar/style='background:#fff;font-size:0;left:0;right:0;top:0;bottom:0;z-index:99990;position:fixed'#/onmouseover=alert('xss:'+document.cookie);") |
| 256 | +``` |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | +PoC 2: |
| 261 | +~~~md |
250 | 262 |
|
251 |
| -PoC: |
252 |
| -```html |
253 |
| -TBA |
254 | 263 | ```
|
| 264 | +#!lolcoad.0000123 |
| 265 | +lol |
| 266 | +``` |
| 267 | +~~~ |
255 | 268 |
|
256 |
| -_Details TBA._ |
| 269 | + |
| 270 | + |
| 271 | +I was surprised by the fact that Bitbucket does not use Content Security Policy at all (they said that they are in the process of adding it). |
| 272 | + |
| 273 | +Note: Atlassian security team managed to disclose the XSS vulnerability before fixing it by testing the PoC in a public repo issues |
| 274 | +on their production server, soon after I reported the issue and provided the PoC privately, and it was public until I noticed that |
| 275 | +after 19 hours. Explanation was the following: «testing your PoC to make sure it was reproducible». |
| 276 | +_They acknowledged that it was accidential — the test repository itself was private, but its issue tracker |
| 277 | +was public. I was able to find my PoC in that public issue tracker, though. |
| 278 | +That repo permissions were fixed in an hour after I noticed that._ |
| 279 | + |
| 280 | +This issue has been passed to the development team after 50 days from the inital report. |
| 281 | + |
| 282 | +An incomplete fix was deployed 57 days after the report — that covered only the first one of the originally reported PoCs |
| 283 | +(the other one did not execute arbitrary JS code, though). |
257 | 284 |
|
258 |
| -██████████████████████████████████████████████████████████████████████████████████████. |
| 285 | +The complete fix was deployed after 78 days from the initial report. |
259 | 286 |
|
260 |
| -Note: ███████████████████████ managed to disclose the XSS vulnerability before fixing it by testing the PoC in a pub███████████ |
261 |
| -█████ production server, soon after I reported the issue and provided the PoC privately, and it was public until I noticed that |
262 |
| -after 19 hours. |
| 287 | +Timeline: |
| 288 | +* Discovered: 2017-04-03 |
| 289 | +* Reported: 2017-04-03 |
| 290 | +* Confirmed by Atlassian Security team: 2017-04-03 |
| 291 | +* PoC leaked to a public repo issues by Atlassian Security team: 2017-04-03 |
| 292 | +* Issue was assigned to the Bitbucket development team: 2017-05-23 |
| 293 | +* Incomplete fix deployed (covered only the first PoC): 2017-05-30 |
| 294 | +* Complete fix deployed: 2017-06-20 |
263 | 295 |
|
264 | 296 | ### TBA 2
|
265 | 297 |
|
@@ -439,7 +471,7 @@ a good one, send me a link, I will include that link here.
|
439 | 471 | ---
|
440 | 472 |
|
441 | 473 | Published (partially): 2017-04-13, 9:01 UTC. \
|
442 |
| -Updated with _TBA_ disclosure: _TBA_. \ |
| 474 | +Updated with Bitbucket XSS disclosure: 2017-06-26 15:40 UTC. \ |
443 | 475 | Updated with _TBA 2_ disclosure: _TBA_. \
|
444 | 476 | Updated with YouTrack disclosure: 2017-04-25, 9:34 UTC.
|
445 | 477 |
|
|
0 commit comments