View Issue Details

IDProjectCategoryView StatusLast Update
0037471mantisbtsecuritypublic2026-10-31 11:19
Reporteralourido Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version2.28.3 
Summary0037471: ERROR 2800 (invalid form security token) on login after idle time on username field when typing manually
Description

Hello,

After enabling form security validation ($g_form_security_validation = ON), APPLICATION ERROR #2800 ("Invalid form security token") occurs on the login flow under a specific condition.

Environment:

  • MantisBT 2.28.3
  • $g_form_security_validation = ON (required; we cannot turn it OFF for security remediation and company guidelines)
  • Login is the two-step flow: login_page.php (username) → login_password_page.php (password) → login.php
  • Browser: [Chrome / Edge]
  • OS: [Windows]

Actual result:
APPLICATION ERROR #2800 – Invalid form security token. The message suggests session timeout or accidental double submit.

Expected result:
Login should succeed, or the user should get a clear “session expired, please reload” without a hard 2800 after only 0000007:0000015 minutes of idle on the username field with CSRF enabled.

Additional observations:

  • If, after the same idle period, the username is chosen from the browser’s suggested/autofill list (click suggestion) instead of typing, the error does NOT occur.
  • The issue appears only when typing the username after idle; autofill click works.
  • So far we only see this on the login flow, not on other forms (still under test).
  • We keep $g_form_security_validation = ON on purpose (CSRF remediation). We are not asking to disable form tokens.

Screenshot of ERROR #2800 is attached.

Questions for developers:

  1. Is ~ 15 minutes idle on login_page expected to invalidate the form token while the PHP session may still be alive?
  2. Is there a recommended pattern for the username → password login steps (token lifetime, purge, PRG) so idle + manual typing does not hit 2800?
  3. Any known interaction between form security tokens and browser autofill vs manual input on the login forms?

Thank you for any guidance.

Best regards

Steps To Reproduce
  1. Open the login page (username step).
  2. Place the cursor in the username field and leave the page idle for about 15 minutes (or longer) without submitting.
  3. Type the username manually (do not use the browser autofill dropdown).
  4. Submit / continue to the password step and complete login.
  5. Observe APPLICATION ERROR #2800.
Additional Information
  • Autofill/click suggestion after the same idle time does not trigger 2800; only manual typing does.
  • Form security validation must remain ON due to security remediation and company guidelines.
  • Issue observed on login only so far.
TagsNo tags attached.
Attached Files

Activities

alourido

alourido

2026-10-30 17:27

reporter   ~0071554

Last edited: 2026-10-30 17:27

In the description and steps, where it may show a strange value such as "0000007:0000015", that refers to the idle time on the username field. The intended meaning is: leave the page idle for 15 minutes or more, then type the username manually and submit. Sorry for the formatting issue; the report cannot be edited.

dregad

dregad

2026-10-31 10:59

developer   ~0071555

where it may show a strange value such as "0000007:0000015"

This is because the tilde character followed by a number creates a link to the corresponding bugnote, i.e. ~15 in this case links to bugnote number 15, belonging to issue 7.

I edited your report to add a space after the ~.

dregad

dregad

2026-10-31 11:19

developer   ~0071556

The duration of the session depends on your php.ini settings (see session.gc-maxlifetime as well as gc-probability and gc-divisor).

I'm not aware that the browser's autotype could refresh the PHP session or the MantisBT CSRF token - that's quite surprising to me. Are you sure this is not a red herring ? If this is consistently reproducible it would be interesting to analyze exactly what is happening.