file - Can below PHP code be exploited? -


can 1 exploit below code :-

    $myfile = fopen("chat.txt", "a") or die("unable save!");     $content = trim($_post['message'])."\n";     fwrite($myfile, $content);     fclose($myfile); 

i making small chat application where, writing content in text file rather mysql. there not performance change, preferring file little faster mysql.

my concern , "can 1 exploit" above code ?

i don't see way, asking, if missing anything.

  • message can contain \n, break order/flow if depend on that,
  • message length not limited make run out of space,
  • there no limit on message number, io mine,
  • message contain xss (like @xorifelse mentioned),
  • message contain control character, annoying e.g. cat

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -