Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Properly lock down app_dev.php #937

Closed
wants to merge 1 commit into from

Conversation

phihag
Copy link
Contributor

@phihag phihag commented Feb 4, 2016

Currently, web/app_dev.php in the symfony-standard package limits requests to those coming from CLI and unproxied localhost.

This prevents an attacker to execute this file in a production environment.

IPv4 localhost requests can come from 127.0.0.0/8, so the current check is actually a little bit too restrictive, but safe.

IPv6 localhost requests come from ::1/128.

The address fe80::1, however, is a link-local IPv6 address like any other. Anyone in the local network can take it and communicate with it. Therefore, it does not belong here.

Currently, web/app_dev.php in the symphony-standard package limits requests to those coming from CLI and unproxied localhost.
This prevents an attacker to execute this file in a production environment.
IPv4 localhost requests can come from 127.0.0.0/8, so the current check is actually a little bit too restrictive, but safe.
IPv6 localhost requests come from ::1/128.
The address fe80::1, however, is a link-local IPv6 address like any other. Anyone in the local network can take it and communicate with it. Therefore, it does not belong here.
@Pierstoval
Copy link
Contributor

Isn't fe80::1 the equivalent of 127.0.0.1 in IPV6?

@phihag
Copy link
Contributor Author

phihag commented Feb 4, 2016

@Pierstoval No, see the text in the commit and pull request description. The closest equivalent to 127.0.0.1 (which is just one out of many loopback addresses in IPv4) would be ::1, the only loopback address in IPv6. fe80::1 is a link-local - that is to say interface-specific - address with no special properties. If you think Wikipedia, the IETF, and I are all mistaken about fe80::1, try it yourself - nobody will answer ping fe80::1%eth0 until you configure the address.

@Tobion
Copy link
Contributor

Tobion commented Feb 4, 2016

👍 Should be merged in 2.3

@xabbuh
Copy link
Member

xabbuh commented Feb 28, 2016

👍

@fabpot
Copy link
Member

fabpot commented Aug 18, 2016

Thank you @phihag.

fabpot added a commit that referenced this pull request Aug 18, 2016
This PR was submitted for the master branch but it was merged into the 2.7 branch instead (closes #937).

Discussion
----------

Properly lock down app_dev.php

Currently, web/app_dev.php in the symfony-standard package limits requests to those coming from CLI and unproxied localhost.

This prevents an attacker to execute this file in a production environment.

IPv4 localhost requests can come from 127.0.0.0/8, so the current check is actually a little bit too restrictive, but safe.

IPv6 localhost requests come from ::1/128.

The address fe80::1, however, is a link-local IPv6 address like any other. Anyone in the local network can take it and communicate with it. Therefore, it does not belong here.

Commits
-------

f63bbbf Properly lock down app_dev.php
@fabpot fabpot closed this Aug 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants