Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7172519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:37:53+00:00 2026-05-28T15:37:53+00:00

Just wondering if requiring a hashed PHPSESSID to be sent to all forms or

  • 0

Just wondering if requiring a hashed PHPSESSID to be sent to all forms or action scripts is enough for CSRF protection? I understand this can be obtained if the user’s are on the same physical network (firesheep). Example:

http://site.com/deleteMessage.php?mid=22&token=MD5ed_PHPSESSID

Disregarding the same network issue the PHPSESSID:

 1) Is known only to the user doing the action
 2) Can not be guessed by an attacker crafting a malicious img or request (<img src="http://site.com/deleteMessage.php?mid=22&token=I_DONT_KNOW_IT_:( )
 3) Can not be pulled on the same site assuming no XSS vulnerabilities exist.
 4) Can easily be pulled by the legitimate user (Javascript fills the form or GET var in the link)

Number 3 worries me, although I don’t have any XSS vulnerabilities that I’m aware of, as I htmlentities($string,ENT_QUOTES)ed everything, I do not like relying on assumptions. Is this sufficient CSRF protection or is there a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:37:54+00:00Added an answer on May 28, 2026 at 3:37 pm

    No, you should use a token that is independent from the session ID. Just think of the case where an attacking site is able to obtain the victim’s session ID somehow (cf. session fixation and session hijacking) but isn’t able to use the session itself due to some additional session protection measures. Then it would still be possible to forge authentic requests as the token can be derived from the known session ID.

    Just use a random token as everyone suggests.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wondering why this works: window.NewListView = Backbone.View.extend({ template: _.template('<a href=/list class=button new-list>Create New
Just wondering if there is a way around this (or if it is even
I just implemented a handler that uses IReadOnlySessionState and was wondering why this marker
Just wondering if there's any tutorials or ways to update jQuery scripts and functions.
Just wondering if anyone can help me with this slight issue. I'm writing a
Just wondering your opinion on how I should model my documents for this scenario.
Just wondering what the correct way of structuring statements like this is? @products =
just wondering where to put this macro. It's supposed to cause correctly labelled excel
Just wondering what code I would need to do this?
Just wondering. Say I have this in a php page <?php if x {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.