Skip to content

Commit 4f001e8

Browse files
committed
Add basic host header injection protection
1 parent 35ba5e4 commit 4f001e8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ To get going clone this repository and perform the following steps:
1111
Alternatively perform all of the following steps manually.
1212
1. Change application name in `config/application.rb`.
1313
1. Update `database.yml` to reflect the new application name.
14+
1. Update `TODO` items in `config/environments/production.rb`.
1415
1. If you plan on using Figaro, copy `config/application.yml.example` to `config/application.yml`.
1516
1. ESLint is preconfigured for modern JS with React support (AirBnB styleguide). If you want to use
1617
it install packages with `npm install`, otherwise remove `.eslintrc` and `package.json`.

config/environments/production.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,11 @@
9393

9494
# Do not dump schema after migrations.
9595
config.active_record.dump_schema_after_migration = false
96+
97+
# TODO: Prevent host header injection
98+
# Uncomment and configure the following configuration option(s).
99+
# If your environment is more difficult (subdomains or different TLDs), try
100+
# https://github.com/synack/rack-allowed_hosts instead.
101+
# config.action_controller.default_url_options = { host: "www.yoursite.com" }
102+
# config.action_controller.asset_host = "www.yoursite.com"
96103
end

0 commit comments

Comments
 (0)