Skip to content
CSRF Disclosed report Beginner

CSRF token does not valided during blog comment

The blog comment submission endpoint did not validate the CSRF token, unlike other POST endpoints such as author profile creation. An attacker could submit a comment on a victim's behalf without their knowledge, though the text only demonstrates the missing check rather than a full cross-site attack.

ranjit_p Follow

Originally disclosed on HackerOne

  • Fixed in 9 hours
  • Paid in 11 hours
  • Disclosed after 13 days

SUMMURY

i tested that all post request has CSRF token. During Author profile creation also a CSRF token is posted. Now when i removed this CSRF token , show s error like bellow

CSRF validation failed

0 /var/www/csprng/src/Cabin/Bridge/Controller/Author.php(52): Airship\Engine\Controller->post(Object(Airship\Cabin\Bridge\Filter\Author\AuthorFilter))
/var/www/csprng/src/Engine/AutoPilot.php(485): Airship\Cabin\Bridge\Controller\Author->create()
 /var/www/csprng/src/Engine/AutoPilot.php(315): Airship\Engine\AutoPilot->serve(Array, Array)
 /var/www/csprng/src/public/index.php(86): Airship\Engine\AutoPilot->route(Object(Airship\Engine\Networking\HTTP\ServerRequest))
{main}

So its a CSRF validation failed error. Now if request submitted with proper CSRF token, then response will be 302 redirect. So, i come to this point that if proper CSRF token provided then we get 302 redirect as success response and If CSRF validation failed then we get above error response or something else.

Now during Blog Reply comment Following request POST data is made


_CSRF_TOKEN=KrkFX0bGkcwgoIKX8Y7KKr1F%3A0ElYiUhZ5wJDSS8kE2FmPxY58Dr3533SH63ZRJBPBfO-&author=47&name=&email=&url=&message=ssdfsfsfsf+sfsd&g-recaptcha-response=03AJzQf7Ojuy_9znHGgl-bZOSweJZo...............

Now remove the CSRF_TOKEN and see 302 redirect as response header, this indicate that request is successfull and server does not checked CSRF here And no CSRF validation error.

HTTP/1.1 302 Found
Date: Tue, 03 Oct 2017 01:15:15 GMT
Content-Type: text/html; charset=UTF-8
Connection: close
Cache-Control: no-store, no-cache, must-revalidate
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Location: https://cspr.ng/blog/2017/05/csprng-airship-dev-branch#comments
Pragma: no-cache
Status: 302 Found

i checked four file are reponsible for blog comment and non of them are checking CSRF. https://github.com/paragonie/airship/blob/master/src/Cabin/Bridge/Controller/Blog.php https://github.com/paragonie/airship/blob/master/src/Cabin/Bridge/Model/Blog.php https://github.com/paragonie/airship/blob/master/src/Cabin/Hull/Model/Blog.php https://github.com/paragonie/airship/blob/master/src/Cabin/Hull/Controller/BlogPosts.php#107 here i see only the last file verify google captcha but not CSRF

STEP TO REPRODUCE

  1. goto any post and comment
  2. capture request and remove CSRF token
  3. submit that request and see successfull, no CSRF validation error

The original report as published on HackerOne, by ranjit_p. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the blog comment controller and model never call the CSRF validation routine that other controllers use, so the token is accepted but ignored.

Impact

A third-party site could cause a logged-in user's browser to post a comment without their consent, though the text does not demonstrate this cross-site attack and a Google reCAPTCHA check is present on the endpoint.

The fix

The comment endpoint should be fixed to validate the CSRF token before accepting a comment.

How it was found

  1. Go to any blog post and submit a comment.
  2. Capture the comment request and remove the CSRF token.
  3. Submit the modified request and observe it succeeds with no CSRF validation error.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

The comment form sent a secret token, but the server never checked it, so a request without the token was accepted. The text only shows the check is missing, not that another site could post as a user.

What is CSRF?

Another site makes a signed-in user's browser perform an action they did not intend.

More by ranjit_p

View all

6 more disclosed reports, best first.

More from Paragon Initiative Enterprises

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site request forgery (CSRF)

The lesson behind this report.

Another site makes a signed-in user's browser perform an action they did not intend.