Skip to content

Improve Frontend Security Posture

This issue should list down all the possible areas where we can make improvement to strengthen our Frontend Security.

Mitigating Cross-site Scripting (XSS)

Update Sanitizer

  1. Swap sanitize-html for dompurify (more robust) - !31928 (merged), gitlab-ui!1636 (merged)

Avoid v-html

Since we know, v-html is bad

  1. Add v-safe-html directive which sanitizes html by default - gitlab-ui!1413 (merged)
  2. Add ESLint rules to prevent using v-html - #232488 (closed)
  3. Audit and remove existing v-html usages - &4273 (closed)

Prevent URL injection

  1. Add safe-link directive to prevent url injection - Documentation, gitlab-ui!1457 (merged)
  2. GlLink component should prevent JS execution by default - gitlab-ui!1472 (merged)
  3. GlButton component should prevent JS execution by default - gitlab-ui#1379 (closed)

Development guidelines

  1. Frontend Security Best Practices - https://docs.gitlab.com/ee/development/secure_coding_guidelines.html#xss-guidelines

Evaluate

Defense in depth

Improve Content Security Policy

Trusted Types

Others

  • Add SameSite cookies
  • Subresource Integrity
Edited by Dheeraj Joshi