php - Is it dangerous thing to view access log without sanitizing via web browser? -


Is it dangerous to view access logs without sensitization through a web browser?

I am considering recording access logs, and I am considering watching it through VV browser, but if the attacker modifies his remote host or user agent or something, So can he attack me?

Attack code is your remote host or user agent or act.

So do I need to clean by htmlspecialchar before opening the access log file via web browser?

I mean that the attacker will insert some attack code in your remote host or user agent, or seeing some things, I see the access lock via the web browser, then my PC will affect that code.

You probably need some HTML formatting for output and so the log data must be sensitized / encrypted For logic: If you send output as text / plain, then the client should not parse any HTML / javascript.
e.g.

  & lt ;? Output of Php header ('content-type: text / plain; charset = UTF-8'); & Lt; Script & gt; Alert (document.URL); & Lt; / Script & gt; Echo & lt; Script & gt; Alert (document.URL); & Lt; / Script & gt; ' 
/ ex> (at least FF3, IE8, Opera, Safari).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -