Skip to content

Mutate some cautions to dangers #19305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion components/http_foundation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ class, which can make this even easier::
The ``JsonResponse`` class sets the ``Content-Type`` header to
``application/json`` and encodes your data to JSON when needed.

.. caution::
.. danger::

To avoid XSSI `JSON Hijacking`_, you should pass an associative array
as the outermost array to ``JsonResponse`` and not an indexed array so
Expand Down
6 changes: 3 additions & 3 deletions components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -843,7 +843,7 @@ instance, to clean up the ``/tmp`` directory or after a reboot of the machine
when a directory uses ``tmpfs``. It's not an issue if the lock is released when
the process ended, but it is in case of ``Lock`` reused between requests.

.. caution::
.. danger::

Do not store locks on a volatile file system if they have to be reused in
several requests.
Expand Down Expand Up @@ -876,7 +876,7 @@ When the Memcached service is shared and used for multiple usage, Locks could be
removed by mistake. For instance some implementation of the PSR-6 ``clear()``
method uses the Memcached's ``flush()`` method which purges and removes everything.

.. caution::
.. danger::

The method ``flush()`` must not be called, or locks should be stored in a
dedicated Memcached service away from Cache.
Expand Down Expand Up @@ -984,7 +984,7 @@ be lost without notifying the running processes.
When the Redis service is shared and used for multiple usages, locks could be
removed by mistake.

.. caution::
.. danger::

The command ``FLUSHDB`` must not be called, or locks should be stored in a
dedicated Redis service away from Cache.
Expand Down
2 changes: 1 addition & 1 deletion components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ are done doing other stuff::
**synchronously** inside this event. Be aware that ``kernel.terminate``
is called only if you use PHP-FPM.

.. caution::
.. danger::

Beware also that if you do that, the said PHP-FPM process will not be
available to serve any new request until the subprocess is finished. This
Expand Down
2 changes: 1 addition & 1 deletion components/yaml.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ And parse them by using the ``PARSE_OBJECT`` flag::
The YAML component uses PHP's ``serialize()`` method to generate a string
representation of the object.

.. caution::
.. danger::

Object serialization is specific to this implementation, other PHP YAML
parsers will likely not recognize the ``php/object`` tag and non-PHP
Expand Down
2 changes: 1 addition & 1 deletion configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ To do so, define a parameter with the same name as the env var using this syntax
always exists, because its value will be ``null`` when the related env var
is not defined.

.. caution::
.. danger::

Beware that dumping the contents of the ``$_SERVER`` and ``$_ENV`` variables
or outputting the ``phpinfo()`` contents will display the values of the
Expand Down
2 changes: 1 addition & 1 deletion configuration/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ running:
This will generate ``config/secrets/prod/prod.encrypt.public.php`` and
``config/secrets/prod/prod.decrypt.private.php``.

.. caution::
.. danger::

The ``prod.decrypt.private.php`` file is highly sensitive. Your team of developers
and even Continuous Integration services don't need that key. If the
Expand Down
2 changes: 1 addition & 1 deletion controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ and ``redirect()`` methods::
return $this->redirect('http://symfony.com/doc');
}

.. caution::
.. danger::

The ``redirect()`` method does not check its destination in any way. If you
redirect to a URL provided by end-users, your application may be open
Expand Down
2 changes: 1 addition & 1 deletion deployment/proxies.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ and what headers your reverse proxy uses to send information:
# ...
trusted_proxies: '%env(TRUSTED_PROXIES)%'

.. caution::
.. danger::

Enabling the ``Request::HEADER_X_FORWARDED_HOST`` option exposes the
application to `HTTP Host header attacks`_. Make sure the proxy really
Expand Down
2 changes: 1 addition & 1 deletion http_cache/cache_invalidation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Then, register the class as a service that :doc:`decorates </service_container/s
;
};

.. caution::
.. danger::

You must protect the ``PURGE`` HTTP method somehow to avoid random people
purging your cached data.
Expand Down
2 changes: 1 addition & 1 deletion http_cache/ssi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The SSI instructions are done via HTML comments:
There are some other `available directives`_ but
Symfony manages only the ``#include virtual`` one.

.. caution::
.. danger::

Be careful with SSI, your website may fall victim to injections.
Please read this `OWASP article`_ first!
Expand Down
2 changes: 1 addition & 1 deletion profiler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Profiler
The profiler is a powerful **development tool** that gives detailed information
about the execution of any request.

.. caution::
.. danger::

**Never** enable the profiler in production environments
as it will lead to major security vulnerabilities in your project.
Expand Down
2 changes: 1 addition & 1 deletion rate_limiter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Symfony uses these rate limiters in built-in features like :ref:`login throttlin
which limits how many failed login attempts a user can make in a given period of
time, but you can use them for your own features too.

.. caution::
.. danger::

By definition, the Symfony rate limiters require Symfony to be booted
in a PHP process. This makes them not useful to protect against `DoS attacks`_.
Expand Down
2 changes: 1 addition & 1 deletion reference/configuration/twig.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ autoescape
If set to ``false``, automatic escaping is disabled (you can still escape each content
individually in the templates).

.. caution::
.. danger::

Setting this option to ``false`` is dangerous and it will make your
application vulnerable to `XSS attacks`_ because most third-party bundles
Expand Down
2 changes: 1 addition & 1 deletion security.rst
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ The form can look like anything, but it usually follows some conventions:
Actually, all of this can be configured under the ``form_login`` key. See
:ref:`reference-security-firewall-form-login` for more details.

.. caution::
.. danger::

This login form is currently not protected against CSRF attacks. Read
:ref:`form_login-csrf` on how to protect your login form.
Expand Down
2 changes: 1 addition & 1 deletion serializer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ custom normalizers and/or encoders can also be loaded by tagging them as
:ref:`serializer.encoder <reference-dic-tags-serializer-encoder>`. It's also
possible to set the priority of the tag in order to decide the matching order.

.. caution::
.. danger::

Always make sure to load the ``DateTimeNormalizer`` when serializing the
``DateTime`` or ``DateTimeImmutable`` classes to avoid excessive memory
Expand Down
2 changes: 1 addition & 1 deletion session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1573,7 +1573,7 @@ Then, register the ``SodiumMarshaller`` service using this key:
]);
};

.. caution::
.. danger::

This will encrypt the values of the cache items, but not the cache keys. Be
careful not to leak sensitive data in the keys.
Expand Down