Mohamed.Bassem's blog

By Mohamed.Bassem, 3 years ago, In English,

I was playing around with Codeforces and inspecting the networking of the website when I decided to check if Codeforces is vulnerable to CSRF (Cross-Site Request Forgery) attacks or not. I found that all requests contain CSRF tokens but I decided to test it anyway. I copied the request to my terminal and removed the CSRF token and it worked! I tried with different requests and apparently the CSRF tokens — although they existed — were never validated. Codeforces was vulnerable to CSRF attacks.

You can read more about it on my blog : http://blog.mbassem.com/2015/05/09/codeforces-account-takeover/

I want to thank MikeMirzayanov for his fast response and fix!

Your comments are welcomed!

Read more »

 
 
 
 
  • Vote: I like it  
  • +414
  • Vote: I do not like it  

By Mohamed.Bassem, 3 years ago, In English,

Hi All,

Reccently I've seen some very nice tutorials here on Codeforces. Tutorials like Algorithm Gym By PrinceOfPersia should not be lost between other blog posts. I think Codeforces should have a pinned tutorials tab in its navbar. This Tutorials page should contain links to verified tutorials on Codeforces, something that's exactly like Topcoder's tutorials but for Codeforces. I guess this will encourage more people to write tutorials with the motive of getting them added to this tutorials archive. I searched before posting this idea but I didn't find any post that suggests something like this.

What do you think ?

Read more »

 
 
 
 
  • Vote: I like it  
  • +35
  • Vote: I do not like it  

By Mohamed.Bassem, 3 years ago, In English,

Hi,

I developed a python tool to distributively run GCJ, FB hacker cup — or any contest in which you submit the output file — testcases on several machines. This should theoretically divide the program running time by the number of machines running plus a small network overhead. It's not yet ready for real contest usage but I hope it'll be ready before the next GCJ or FB hacker cup round.

Github Repo : https://github.com/MohamedBassem/dTests

Or you can download it from : https://pypi.python.org/pypi?name=dTests&:action=display

Check the repo for more info, installation and usage guide.

Your ideas and contributions are more than welcome! :)

Read more »

 
 
 
 
  • Vote: I like it  
  • +36
  • Vote: I do not like it  

By Mohamed.Bassem, 5 years ago, In English,

Hi all,

Is there any way to view my submissions for the problem i'm viewing now other than searching my submissions list for it ? if there isn't I think it would be great if we have a button in the problem's page to view our submissions for this problem.

Thanks :)

Read more »

 
 
 
 
  • Vote: I like it  
  • +15
  • Vote: I do not like it  

By Mohamed.Bassem, 5 years ago, In English,

Hi All, I'm getting a strange precision error in this problem : 284C - Cows and Sequence and this is my code : 3346105 I know that this problem could be solved by many other ways , but what's wrong with this implementation ? I'm using a segment tree with lazy propagation , every node contains three integers , the value of the node ( which is the summation over this range ) the update flag ( and value ) and the number of leafs under this node.

Thanks :)

UPDATE : The problem was that integers overflow and the size of the vector was causing some problems too , Thanks to HadronWave and here is my accepted solution 3348952 :)

Read more »

 
 
 
 
  • Vote: I like it  
  • -13
  • Vote: I do not like it  

By Mohamed.Bassem, 5 years ago, In English,

Hi All, I would like to know how to hack a code on Codeforces using a generator , could someone please show me a sample generator that he used before ? Thank You :)

UDPATE : You should print a new line at the end of the generated case , Thank You guys :)

Read more »

 
 
 
 
  • Vote: I like it  
  • +13
  • Vote: I do not like it