Session Fixation in fobybus/social-media-skeleton

Valid

Reported on

Aug 25th 2023


Description

Session fixation allows an attacker to impersonate a user by abusing an authenticated session ID (SID). This attack can occur when a web application: •Fails to supply a new, unique SID to a user following a successful authentication •Allows a user to provide the SID to be used after authenticating In a session fixation attack, the attacker creates or obtains a valid session identifier and causes the user to provide authentication credentials to the application along with the session identifier. If the application fails to renew this SID after the user logs in, the attacker can use the previously obtained/created value of this SID to clone the authenticated session. The attacker can continue to impersonate the victim user until the SID expires. The need to brute-force or intercept the SID is eliminated.

Proof of Concept

https://drive.google.com/file/d/16veuc5I1qEM8qKmz_DiyRLrTmi8F-O8c/view?usp=sharing

#Remediation: The best way to prevent session fixation attacks is to renew the session ID when a user logs in. This fix can be done at the code level or framework level, depending on where the session management functionality is implemented. Example 1: the following PHP code changes the session ID after users log in successfully:

If ($authenication_successful) { 
    $_session[“authenticated”] = true;
    Session_regenerate_id();
}

Example 2: When deploying web applications to Apache Tomcat, care must be taken to set the “changeSessionIdOnAuthentication” attribute in context.xml to true. Additionally, session IDs should be sufficiently random and should be invalidated at logout.

Impact

Authenticating a user but failing to provision a new session identifier gives an attacker the opportunity to steal authenticated sessions of victim users. This attack breaks the data confidentiality and integrity of victim users.

We are processing your report and will contact the fobybus/social-media-skeleton team within 24 hours. a month ago
Mohamed Faizal modified the report
a month ago
We have contacted a member of the fobybus/social-media-skeleton team and are waiting to hear back a month ago
Mohamed Faizal
24 days ago

Researcher


any updates on this?

fobybus gave praise 24 days ago
go ahead and fix it!
The researcher's credibility has slightly increased as a result of the maintainer's thanks: +1
fobybus validated this vulnerability 24 days ago
Mohamed Faizal has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
fobybus gave praise 24 days ago
go ahead and fix it!
The researcher's credibility has slightly increased as a result of the maintainer's thanks: +1
fobybus marked this as fixed in 1.0.5 with commit 8c632f 23 days ago
fobybus has been awarded the fix bounty
This vulnerability will not receive a CVE
fobybus published this vulnerability 23 days ago
to join this conversation