Using PSR-3 placeholders properly
3 years ago in PHP by crell (60)
$2.96
- Past Payouts $2.96
- - Author $1.49
- - Curators $1.46
148 votes
- xeldal: $0.62
- minnowbooster: $0.60
- zuerich: $0.50
- steemstem: $0.31
- enki: $0.21
- lemouth: $0.14
- rocky1: $0.06
- curie: $0.05
- stemsocial: $0.05
- mcsvi: $0.05
- dhimmel: $0.03
- checkyzk: $0.03
- roelandp: $0.02
- spiritabsolute: $0.02
- adol: $0.02
- massivevibration: $0.01
- techslut: $0.01
- stayoutoftherz: $0.01
- r00sj3: $0.01
- smartsteem: $0.01
- and 128 more
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!
Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).
You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support.
As an addendum, thank you to the Symfony docs folks who have already addressed the highlighted issue and updated their Logging documentation accordingly.
https://reddit.com/r/PHP/comments/11k2o6i/on_the_use_of_psr3_placeholders/
The rewards earned on this comment will go directly to the people sharing the post on Reddit as long as they are registered with @poshtoken. Sign up at https://hiveposh.com.
And now Laravel has updated their configuration to default new projects to interpolating PSR-3 placeholders, too!
The Laravel docs have now also been updated accordingly!
Thanks for pointing that out! I was indeed using PSR-3 loggers incorrectly without knowing it. However, I don't understand how placeholders reduce the security risk.
User supplied data should be sanitised anyway, whether used directly in the log message (which I now know is wrong) or in the context array. What am I missing?
Or is it meant to not sanitise user supplied data and persist whatever comes (including malicious stuff) and let the part of the software that displays the logs and interpolates the placeholders take care of the risk?
HTTP is in use instead of HTTPS and no protocol redirection is in place. Do not enter sensitive information in this website as your data won't be encrypted.
Read about HTTP unsafety: [https://whynohttps.com](1) [https://web.dev/why-https-matters](2)
_ Vote for our WITNESS to support this FREE service!