Skip to content

Security hardening, dependency updates, and CI fixes - #1030

Open
AevumDecessus wants to merge 68 commits into
masterfrom
dev
Open

Security hardening, dependency updates, and CI fixes#1030
AevumDecessus wants to merge 68 commits into
masterfrom
dev

Conversation

@AevumDecessus

@AevumDecessus AevumDecessus commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Merges all changes from dev to master since the last sync. This release includes security hardening from a full codebase audit, routine dependency bumps, and CI workflow fixes.

Security Fixes

pyjwt 2.12.1 -> 2.13.0 (#1013) - 5 CVEs patched, most critical: GHSA-xgmm-8j9v-c9wx (JWK JSON accepted as HMAC secret, algorithm confusion attack). Used by django-oauth-toolkit and social-auth-app-django in the authentication path.

Remove django-oauth-toolkit (#1025) - The OAuth2 provider at /o/ was installed but never used (0 registered applications). Any authenticated guild member could register an OAuth2 app for phishing. Removed entirely along with its transitive dependency jwcrypto.

Stream key PRNG + entropy (#1024) - Replaced random.choices (Mersenne Twister) with secrets.choice (OS CSPRNG). Expanded wordlist from 310 to 1000 verified 3-4 syllable words. Entropy increased from 33.1 to 39.9 bits (key space from ~9.2 billion to 1 trillion).

CSRF_TRUSTED_ORIGINS (#1026) - Added the setting required by Django 5.2. Hardcodes prod and dev origins; additional origins (fragdev, local Caddy) configurable via env var.

ORM order_by injection (#1028) - User-controlled orderBy parameter passed directly to .order_by() now validated against a whitelist. Invalid values silently fall back to id.

Pin actions/checkout SHA (#1027) - The sync-dev-to-master.yaml workflow was the only one using a mutable @v6 tag with contents:write permission. Pinned to the same SHA used by all other workflows.

CI/CD Fixes

SonarCloud JRE provisioning (#1018) - sonarqube-scan-action v7's JRE provisioning endpoint returns 403 on the free open source plan. Added actions/setup-java so the scanner uses the system JRE and skips the API call.

Bump actions/setup-java to v5.2.0 (#1019) - v4 ran on Node.js 20 (deprecated June 2, 2026). v5.2.0 targets Node.js 24.

Dependency Bumps

Package From To PR Notes
pyjwt 2.12.1 2.13.0 #1013 Security release, 5 CVEs
certifi 2026.4.22 2026.5.20 #1011 CA bundle refresh
aiohappyeyeballs 2.6.1 2.6.2 #1012 Bug fix in connection algorithm
idna 3.15 3.17 #1014, #1020 Memory reduction, input length cap
click 8.4.0 8.4.1 #1015 Bug fixes
coverage 7.14.0 7.14.1 #1016 Dev/CI only, HTML report fix
redis 7.4.0 8.0.0 #1021 Major bump, tested locally against all 5 DB indexes
pip 26.1.1 26.1.2 #1022 Dev only, security hardening
django-oauth-toolkit 3.2.0 removed #1023, #1025 Bumped then removed entirely

Production Deployment Notes

After deploying, drop the stale oauth2_provider tables (0 data in all):

DROP TABLE IF EXISTS oauth2_provider_accesstoken CASCADE;
DROP TABLE IF EXISTS oauth2_provider_application CASCADE;
DROP TABLE IF EXISTS oauth2_provider_grant CASCADE;
DROP TABLE IF EXISTS oauth2_provider_idtoken CASCADE;
DROP TABLE IF EXISTS oauth2_provider_refreshtoken CASCADE;
DELETE FROM django_migrations WHERE app = 'oauth2_provider';

Set CSRF_TRUSTED_ORIGINS in .env for any non-production/dev environments (e.g. CSRF_TRUSTED_ORIGINS=https://fragdev.0n5.us,https://localhost:8443). Production and dev origins are hardcoded and require no env var.

Test plan

  • All individual PRs passed CI before merge
  • SonarCloud Quality Gate passed on all PRs
  • Redis 8.0.0 tested locally (cache, Celery broker, all 5 DB indexes)
  • Stream key generation verified in container (1000 words, secrets.choice, no dupes)
  • CSRF_TRUSTED_ORIGINS verified in container (hardcoded + env var override)
  • OAuth2 provider removal verified (570 tests pass, no module references remain)
  • PR CI checks pass
  • Production deploy: drop oauth2_provider tables
  • Production deploy: verify /o/ returns 404
  • Production deploy: verify stream key generation still works

dependabot Bot and others added 30 commits May 21, 2026 02:14
Bumps [certifi](https://github.com/certifi/python-certifi) from 2026.4.22 to 2026.5.20.
- [Commits](certifi/python-certifi@2026.04.22...2026.05.20)

---
updated-dependencies:
- dependency-name: certifi
  dependency-version: 2026.5.20
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aiohappyeyeballs](https://github.com/aio-libs/aiohappyeyeballs) from 2.6.1 to 2.6.2.
- [Release notes](https://github.com/aio-libs/aiohappyeyeballs/releases)
- [Changelog](https://github.com/aio-libs/aiohappyeyeballs/blob/main/CHANGELOG.md)
- [Commits](aio-libs/aiohappyeyeballs@v2.6.1...v2.6.2)

---
updated-dependencies:
- dependency-name: aiohappyeyeballs
  dependency-version: 2.6.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
…ls-2.6.2

Bump aiohappyeyeballs from 2.6.1 to 2.6.2
Bumps [pyjwt](https://github.com/jpadilla/pyjwt) from 2.12.1 to 2.13.0.
- [Release notes](https://github.com/jpadilla/pyjwt/releases)
- [Changelog](https://github.com/jpadilla/pyjwt/blob/master/CHANGELOG.rst)
- [Commits](jpadilla/pyjwt@2.12.1...2.13.0)

---
updated-dependencies:
- dependency-name: pyjwt
  dependency-version: 2.13.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [idna](https://github.com/kjd/idna) from 3.15 to 3.16.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](kjd/idna@v3.15...v3.16)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.16'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [click](https://github.com/pallets/click) from 8.4.0 to 8.4.1.
- [Release notes](https://github.com/pallets/click/releases)
- [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst)
- [Commits](pallets/click@8.4.0...8.4.1)

---
updated-dependencies:
- dependency-name: click
  dependency-version: 8.4.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.0 to 7.14.1.
- [Release notes](https://github.com/coveragepy/coveragepy/releases)
- [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst)
- [Commits](coveragepy/coveragepy@7.14.0...7.14.1)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.14.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
sonarqube-scan-action v7 introduced a JRE provisioning step that calls /analysis/jres on the SonarCloud API. This endpoint requires a Scoped Organization Token, which is a paid feature unavailable on the free open source plan. The personal access token returns HTTP 403, breaking all SonarCloud Analysis runs.

Fix: add actions/setup-java before the scan steps. The scanner checks JAVA_HOME before attempting JRE provisioning -- when a system JRE is present it skips the /analysis/jres call entirely, bypassing the 403.
…ioning

Fix SonarCloud JRE provisioning 403 on free plan
v4 (c1e3236) runs on Node.js 20 which GitHub is deprecating June 2, 2026. v5.2.0 (be666c2) targets Node.js 24 and is the current latest release.
Bump actions/setup-java from v4 to v5.2.0 in sonar workflow
Bumps [idna](https://github.com/kjd/idna) from 3.16 to 3.17.
- [Release notes](https://github.com/kjd/idna/releases)
- [Changelog](https://github.com/kjd/idna/blob/master/HISTORY.md)
- [Commits](kjd/idna@v3.16...v3.17)

---
updated-dependencies:
- dependency-name: idna
  dependency-version: '3.17'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [redis](https://github.com/redis/redis-py) from 7.4.0 to 8.0.0.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](redis/redis-py@v7.4.0...v8.0.0)

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 8.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [pip](https://github.com/pypa/pip) from 26.1.1 to 26.1.2.
- [Changelog](https://github.com/pypa/pip/blob/main/NEWS.rst)
- [Commits](pypa/pip@26.1.1...26.1.2)

---
updated-dependencies:
- dependency-name: pip
  dependency-version: 26.1.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [django-oauth-toolkit](https://github.com/django-oauth/django-oauth-toolkit) from 3.2.0 to 3.3.0.
- [Release notes](https://github.com/django-oauth/django-oauth-toolkit/releases)
- [Changelog](https://github.com/django-oauth/django-oauth-toolkit/blob/master/CHANGELOG.md)
- [Commits](django-oauth/django-oauth-toolkit@3.2.0...3.3.0)

---
updated-dependencies:
- dependency-name: django-oauth-toolkit
  dependency-version: 3.3.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Switch from random.choices (Mersenne Twister) to secrets.choice (OS CSPRNG) for stream key generation. Expand the wordlist from 310 to 1000 verified 3-4 syllable words, increasing entropy from 33.1 bits to 39.9 bits (key space from ~9.2 billion to 1 trillion combinations). All words programmatically verified to be 3-4 syllables with no duplicates.
…oolkit-3.3.0

Bump django-oauth-toolkit from 3.2.0 to 3.3.0
Use cryptographic PRNG and expand wordlist for stream key generation
The OAuth2 provider at /o/ was installed but never used -- zero registered applications in both dev and production (verified 2026-06-02). Any authenticated guild member could register an OAuth2 application and use it to phish other users with a legitimate-looking consent screen on fragforce.org.

Removes django-oauth-toolkit from INSTALLED_APPS, URL config, pyproject.toml, and all lockfiles. Also removes its sole transitive dependency jwcrypto. Discord login (social-auth-app-django) and role sync (py-cord bot) are unaffected -- they use completely separate code paths.
Remove unused OAuth2 provider (django-oauth-toolkit)
Hardcodes production and dev origins. Additional origins (fragdev, local Caddy proxy, etc.) can be appended via the CSRF_TRUSTED_ORIGINS env var as a comma-separated list.
AevumDecessus and others added 4 commits June 6, 2026 11:50
---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.14.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@sonarqubecloud

sonarqubecloud Bot commented Jun 6, 2026

Copy link
Copy Markdown

dependabot Bot and others added 24 commits June 8, 2026 01:42
Bumps [bleach](https://github.com/mozilla/bleach) from 6.3.0 to 6.4.0.
- [Changelog](https://github.com/mozilla/bleach/blob/main/CHANGES)
- [Commits](mozilla/bleach@v6.3.0...v6.4.0)

---
updated-dependencies:
- dependency-name: bleach
  dependency-version: 6.4.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [setuptools](https://github.com/pypa/setuptools) from 82.0.1 to 83.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](pypa/setuptools@v82.0.1...v83.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-version: 83.0.0
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [tzdata](https://github.com/python/tzdata) from 2026.2 to 2026.3.
- [Release notes](https://github.com/python/tzdata/releases)
- [Changelog](https://github.com/python/tzdata/blob/master/NEWS.md)
- [Commits](python/tzdata@2026.2...2026.3)

---
updated-dependencies:
- dependency-name: tzdata
  dependency-version: '2026.3'
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [typing-extensions](https://github.com/python/typing_extensions) from 4.15.0 to 4.16.0.
- [Release notes](https://github.com/python/typing_extensions/releases)
- [Changelog](https://github.com/python/typing_extensions/blob/main/CHANGELOG.md)
- [Commits](python/typing_extensions@4.15.0...4.16.0)

---
updated-dependencies:
- dependency-name: typing-extensions
  dependency-version: 4.16.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [charset-normalizer](https://github.com/jawah/charset_normalizer) from 3.4.7 to 3.4.9.
- [Release notes](https://github.com/jawah/charset_normalizer/releases)
- [Changelog](https://github.com/jawah/charset_normalizer/blob/master/CHANGELOG.md)
- [Commits](jawah/charset_normalizer@3.4.7...3.4.9)

---
updated-dependencies:
- dependency-name: charset-normalizer
  dependency-version: 3.4.9
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.14.0 to 3.14.3.
- [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst)
- [Commits](aio-libs/aiohttp@v3.14.0...v3.14.3)

---
updated-dependencies:
- dependency-name: aiohttp
  dependency-version: 3.14.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [tzlocal](https://github.com/regebro/tzlocal) from 5.3.1 to 5.4.4.
- [Changelog](https://github.com/regebro/tzlocal/blob/master/CHANGES.txt)
- [Commits](regebro/tzlocal@5.3.1...5.4.4)

---
updated-dependencies:
- dependency-name: tzlocal
  dependency-version: 5.4.4
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
…izer-3.4.9

Bump charset-normalizer from 3.4.7 to 3.4.9
…ons-4.16.0

Bump typing-extensions from 4.15.0 to 4.16.0
Bumps [redis](https://github.com/redis/redis-py) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](redis/redis-py@v8.0.0...v8.0.1)

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 8.0.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [asttokens](https://github.com/gristlabs/asttokens) from 3.0.1 to 3.0.2.
- [Release notes](https://github.com/gristlabs/asttokens/releases)
- [Commits](gristlabs/asttokens@v3.0.1...v3.0.2)

---
updated-dependencies:
- dependency-name: asttokens
  dependency-version: 3.0.2
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [pip-tools](https://github.com/jazzband/pip-tools) from 7.5.3 to 7.6.0.
- [Release notes](https://github.com/jazzband/pip-tools/releases)
- [Changelog](https://github.com/jazzband/pip-tools/blob/main/CHANGELOG.md)
- [Commits](jazzband/pip-tools@v7.5.3...v7.6.0)

---
updated-dependencies:
- dependency-name: pip-tools
  dependency-version: 7.6.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [coverage](https://github.com/coveragepy/coveragepy) from 7.14.1 to 7.15.2.
- [Release notes](https://github.com/coveragepy/coveragepy/releases)
- [Changelog](https://github.com/coveragepy/coveragepy/blob/main/CHANGES.rst)
- [Commits](coveragepy/coveragepy@7.14.1...7.15.2)

---
updated-dependencies:
- dependency-name: coverage
  dependency-version: 7.15.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Bumps [django](https://github.com/django/django) from 5.2.15 to 5.2.16.
- [Commits](django/django@5.2.15...5.2.16)

---
updated-dependencies:
- dependency-name: django
  dependency-version: 5.2.16
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@sonarqubecloud

Copy link
Copy Markdown

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