Skip to content

Commit

Permalink
Merge pull request #393 from NOAA-OWP/github392
Browse files Browse the repository at this point in the history
Fixing vulnerabilities; refs GitHub #392
  • Loading branch information
HankHerr-NOAA authored Jan 31, 2025
2 parents fd0b036 + 5f83068 commit 57ce297
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions wres-tasker/src/wres/tasker/Tasker.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,16 @@ public boolean handle( Request request,
.add( "X-Frame-Options", "DENY" );
response.getHeaders()
.add( "strict-transport-security", "max-age=31536000; includeSubDomains; preload;" );
response.getHeaders()
.add( "Content-Security-Policy", "default-src 'self' https: data: blob:;"
+ " script-src 'self' 'unsafe-inline' 'unsafe-eval' https: data: blob:;"
+ " style-src 'self' 'unsafe-inline' https: data: blob:;"
+ " img-src 'self' data: https:;"
+ " font-src 'self' data:;"
+ " connect-src 'self' https:;"
+ " object-src 'none';");
response.getHeaders()
.add( "Referrer-Policy", "strict-origin-when-cross-origin" );
return super.handle( request, response, callback );
}
};
Expand All @@ -196,6 +206,9 @@ public boolean handle( Request request,

HttpConfiguration httpConfig = new HttpConfiguration();

// Remover Server from the response headers.
httpConfig.setSendServerVersion( false );

// Support HTTP/1.1
HttpConnectionFactory httpOneOne = new HttpConnectionFactory( httpConfig );

Expand Down

0 comments on commit 57ce297

Please sign in to comment.