Skip to content

Commit

Permalink
fix(ui): prevent xss from log
Browse files Browse the repository at this point in the history
  • Loading branch information
tchiotludo committed Oct 11, 2022
1 parent 3aa78cc commit e2fbcb2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
17 changes: 15 additions & 2 deletions ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@
"vue-select": "^3.20.0",
"vue-sidebar-menu": "^4.8.1",
"vue2-datepicker": "^3.11.0",
"vuex": "^3.6.2"
"vuex": "^3.6.2",
"xss": "^1.0.14"
},
"devDependencies": {
"@babel/core": "^7.18.13prismjs",
Expand Down
3 changes: 2 additions & 1 deletion ui/src/components/logs/LogLine.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
</template>
<script>
import Convert from "ansi-to-html"
import xss from "xss";
let convert = new Convert();
export default {
Expand Down Expand Up @@ -96,7 +97,7 @@
);
},
message() {
return !this.log.message ? "" : convert.toHtml(this.log.message);
return !this.log.message ? "" : convert.toHtml(xss(this.log.message));
}
},
};
Expand Down

0 comments on commit e2fbcb2

Please sign in to comment.