Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion etc/local.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ credentials = true
attachments_enable = true
; https://docs.couchdb.org/en/stable/cve/2021-38295.html
; use nginx instead to allow only signed couchapps when on deployed server
attachments_header_value = "child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';"
; " quotes are in the csp and need to be removed
attachments_header_value = "child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' https://localhost:6984 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';"
Comment on lines +12 to +13

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

This comment correctly notes that the quotes in the attachments_header_value should be removed, but they are still present on the next line. The quotes will likely cause the Content Security Policy to be invalid. Please remove the quotes from the value, and you can remove this comment as well.

attachments_header_value = child-src 'self' data: blob:; default-src 'self'; connect-src 'self' https://corpusdev.example.com https://localhost:3183 https://www.google-analytics.com; img-src 'self' data: https://secure.gravatar.com; font-src 'self' https://themes.googleusercontent.com; script-src 'self' https://localhost:6984 'unsafe-eval' https://www.google-analytics.com; style-src 'self' 'unsafe-inline';

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The Content Security Policy includes 'unsafe-eval' and 'unsafe-inline'. These directives significantly weaken the security of your application and should be avoided as they create openings for Cross-Site Scripting (XSS) attacks.

  • 'unsafe-inline' allows inline <script> and <style> tags, as well as inline event handlers (e.g., onclick). Consider moving all scripts and styles to external files.
  • 'unsafe-eval' allows the use of eval() and similar functions. It's best to refactor any code that relies on these.

Even for a local development configuration, it's a security best practice to have a strict CSP. This helps catch potential issues before they reach production.


[couchdb]
single_node=true
Expand Down
Loading