Skip to content

sec: Fix a SQL injection in advanced search - #236

Merged
marien-probesys merged 1 commit into
2.1from
sec/advanced-search-sql-injection
Jul 31, 2025
Merged

sec: Fix a SQL injection in advanced search#236
marien-probesys merged 1 commit into
2.1from
sec/advanced-search-sql-injection

Conversation

@marien-probesys

@marien-probesys marien-probesys commented Jul 31, 2025

Copy link
Copy Markdown
Member

Context

The advanced search was subject to an attack by SQL injection. A malicious user with admin rights could forge a request and alter the sort parameters in order to execute a SQL request, such as a DELETE statement.

The attack is difficult to exploit by an external attacker as a POST request must be performed and the session cookies are not sent if the HTTP request is performed from outside AgentJ thanks to the SameSite policy.

Related issue(s)

N/A

How to test manually

  1. In the advanced search, open the dev console
  2. Perform a search and edit the HTTP request to perform a SQL injection of your own
  3. Verify that the request is not executed

Reviewer checklist

  • Code is manually tested
  • Interface works on both mobiles and big screens
  • Interface works on both Firefox and Chrome
  • Tests are up to date
  • Documentation is up to date
  • Pull request has been reviewed and approved

The advanced search was subject to an attack by SQL injection. A
malicious user with admin rights could forge a request and alter the
sort parameters in order to execute a SQL request, such as a DELETE
statement.

The attack is difficult to exploit by an external attacker as a POST
request must be performed and the session cookies are not sent if the
HTTP request is performed from outside AgentJ thanks to the `SameSite`
policy.
@marien-probesys
marien-probesys changed the base branch from main to 2.1 July 31, 2025 07:58
@marien-probesys
marien-probesys merged commit 0b14160 into 2.1 Jul 31, 2025
3 checks passed
@marien-probesys
marien-probesys deleted the sec/advanced-search-sql-injection branch July 31, 2025 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant