Fix Gitlab/JsonSafeParse: app/models/active_session.rb

Fix Gitlab/JsonSafeParse violations in this file by replacing Gitlab::Json.parse with Gitlab::Json.safe_parse.

Related MR: !215073 (merged)

Implementation Plan

A contributor needs to:

  1. Replace Gitlab::Json.parse with Gitlab::Json.safe_parse in this file.

  2. Verify with the MR reviewer that the new size and depth limits imposed by safe_parse do not break any existing functionalities. The safe_parse method includes built-in protections against:

    • Excessively large JSON payloads
    • Deeply nested JSON structures

    Ensure that legitimate use cases in this file are not affected by these limits.

Edited by Félix Veillette-Potvin