Skip to content

Commit

Permalink
fix: Changes NGINX Content-Security-Policy configuration to allow dat…
Browse files Browse the repository at this point in the history
…a urls as image src and adds `data:` to the forbidden keywords.

Co-authored-by: Jens Kutzsche <github@gebea.de>
PR #862
  • Loading branch information
mad-nuts authored Jun 30, 2022
1 parent a378e58 commit cedf240
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion infrastructure/dev/nginx/iris-client.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ server {
# X Frame Options - no iframes allowed
add_header X-Frame-Options DENY;
# Content Security Policy - no iframes or external resources allowed
add_header Content-Security-Policy "default-src 'self'; child-src 'none'; frame-ancestors 'none';";
add_header Content-Security-Policy "default-src 'self'; child-src 'none'; frame-ancestors 'none'; object-src 'none'; img-src 'self' data:;";
# X-XSS-Protection - legacy, should be covered by CSP
add_header X-XSS-Protection "1; mode=block";
# Referrer-Policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ server {
# X Frame Options - no iframes allowed
add_header X-Frame-Options DENY;
# Content Security Policy - no iframes or external resources allowed
add_header Content-Security-Policy "default-src 'self'; child-src 'none'; frame-ancestors 'none';";
add_header Content-Security-Policy "default-src 'self'; child-src 'none'; frame-ancestors 'none'; object-src 'none'; img-src 'self' data:;";
# X-XSS-Protection - legacy, should be covered by CSP
add_header X-XSS-Protection "1; mode=block";
# Referrer-Policy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ public interface MessageDataPayload extends Payload {}
private static final String[][] FORBIDDEN_KEYWORD_TUPLES = {
{ "<SCRIPT" },
{ "JAVASCRIPT:" },
{ "DATA:" },
{ "SELECT", "FROM" },
{ "INSERT", "INTO" },
{ "UPDATE", "SET" },
Expand Down

0 comments on commit cedf240

Please sign in to comment.