Commit 7e1100e
gitweb: add $prevent_xss option to prevent XSS by repository content
Add a gitweb configuration variable $prevent_xss that disables features
to prevent content in repositories from launching cross-site scripting
(XSS) attacks in the gitweb domain. Currently, this option makes gitweb
ignore README.html (a better solution may be worked out in the future)
and serve a blob_plain file of an untrusted type with
"Content-Disposition: attachment", which tells the browser not to show
the file at its original URL.
The XSS prevention is currently off by default.
Signed-off-by: Matt McCutchen <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent 6e46cc0 commit 7e1100e
2 files changed
+27
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
217 | 222 | | |
218 | 223 | | |
219 | 224 | | |
| |||
260 | 265 | | |
261 | 266 | | |
262 | 267 | | |
263 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
264 | 271 | | |
265 | 272 | | |
266 | 273 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
135 | 139 | | |
136 | 140 | | |
137 | 141 | | |
| |||
4494 | 4498 | | |
4495 | 4499 | | |
4496 | 4500 | | |
4497 | | - | |
| 4501 | + | |
| 4502 | + | |
| 4503 | + | |
4498 | 4504 | | |
4499 | 4505 | | |
4500 | 4506 | | |
| |||
4739 | 4745 | | |
4740 | 4746 | | |
4741 | 4747 | | |
| 4748 | + | |
| 4749 | + | |
| 4750 | + | |
| 4751 | + | |
| 4752 | + | |
| 4753 | + | |
| 4754 | + | |
| 4755 | + | |
| 4756 | + | |
4742 | 4757 | | |
4743 | 4758 | | |
4744 | 4759 | | |
4745 | | - | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
4746 | 4763 | | |
4747 | 4764 | | |
4748 | 4765 | | |
| |||
0 commit comments