GHSA-wjrh-hj83-3wh7

Suggest an improvement
Source
https://github.com/advisories/GHSA-wjrh-hj83-3wh7
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2025/05/GHSA-wjrh-hj83-3wh7/GHSA-wjrh-hj83-3wh7.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-wjrh-hj83-3wh7
Aliases
Published
2025-05-27T18:03:19Z
Modified
2025-05-27T18:28:28.082747Z
Severity
  • 8.2 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N CVSS Calculator
Summary
Django-Select2 Vulnerable to Widget Instance Secret Cache Key Leaking
Details

Impact

Instances of HeavySelect2Mixin subclasses like the ModelSelect2MultipleWidget and ModelSelect2Widget can secret access tokens across requests. This can allow users to access restricted querysets and restricted data.

Patches

The problem has been patched in version 8.4.1 and all following versions.

Workarounds

This vulnerability is limited use cases where instances of widget classes are created during app loading (not during a request).

Example of affected code:

class MyForm(forms.ModelForm):
    class Meta:
        widgets = {"my_select_field": Select2ModelWidget()}

Django allows you to pass just the widget class (not the instance). This can be used to mitigate the session request leak.

Example of affected code:

class MyForm(forms.ModelForm):
    class Meta:
        widgets = {"my_select_field": Select2ModelWidget}

References

Thanks to @neartik for reporting this issue. I will address it later. I had to delete your issue, to avoid exploitation of this security issue.

Database specific
{
    "nvd_published_at": "2025-05-27T15:15:35Z",
    "cwe_ids": [
        "CWE-402",
        "CWE-918"
    ],
    "severity": "HIGH",
    "github_reviewed": true,
    "github_reviewed_at": "2025-05-27T18:03:19Z"
}
References

Affected packages

PyPI / django-select2

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
8.4.1

Affected versions

2.*

2.0.1

3.*

3.0
3.0.1
3.0.2
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
3.2.0
3.2.1
3.3.0
3.3.1

4.*

4.0.0
4.2.0
4.2.1
4.2.2
4.3.0
4.3.1
4.3.2

5.*

5.0.0
5.0.1
5.0.2
5.0.3
5.1.0
5.1.1
5.2.0
5.2.1
5.3.0
5.3.1
5.4.0
5.4.1
5.4.2
5.4.3
5.5.0
5.6.0
5.7.0
5.7.1
5.8.0
5.8.1
5.8.2
5.8.3
5.8.4
5.8.5
5.8.6
5.8.7
5.8.9
5.8.10
5.9.0
5.10.0
5.11.0
5.11.1

6.*

6.0.0
6.0.1
6.0.2
6.0.3
6.1.0
6.1.1
6.1.2
6.2.0
6.3.0
6.3.1

7.*

7.0.2
7.0.3
7.0.4
7.0.5
7.1.0
7.1.1
7.1.2
7.2.0
7.2.2
7.2.3
7.2.4
7.3.0
7.4.1
7.4.2
7.5.0
7.6.0
7.6.1
7.6.2
7.7.0
7.7.1
7.7.2
7.7.3
7.8.1
7.9.0
7.10.0
7.10.1
7.11.0
7.11.1

8.*

8.0.0
8.1.0
8.1.1
8.1.2
8.2.0
8.2.1
8.2.2
8.2.3
8.3.0
8.4.0