Skip to content

chore(security): SSO security review + pyOpenSSL CVE fix#392

Merged
remyluslosius merged 5 commits into
mainfrom
chore/sso-security-review
Apr 14, 2026
Merged

chore(security): SSO security review + pyOpenSSL CVE fix#392
remyluslosius merged 5 commits into
mainfrom
chore/sso-security-review

Conversation

@remyluslosius
Copy link
Copy Markdown
Contributor

Closes Q2 Workstream G residual item: SSO security review.

Summary

Automated + manual security review of the SSO federation code. One real transitive CVE chain fixed; two defense-in-depth items filed as follow-ups (#390, #391).

Changes

  • Pin `pyOpenSSL==26.0.0` in `backend/requirements.txt` — fixes CVE-2026-27448 and CVE-2026-27459 (previously pulled in as transitive `22.0.0` via pysaml2)
  • Add `docs/SSO_SECURITY_REVIEW_2026-04-14.md` documenting tools run, findings, controls verified
  • `.gitignore`: whitelist `docs/SECURITY_REVIEW.md` and `docs/OW_SECURITY_ASSESSMENT.md` so security review artifacts are tracked for audit trail

Tool results

Tool Scope Findings
Bandit 1.9.4 (high+medium) SSO code (650 LOC) 0
Bandit (any severity) SSO code 1 (B105 false positive on `"bearer"` literal — OAuth2 standard)
Semgrep p/security-audit + p/owasp-top-ten + p/jwt + p/python SSO code 0 findings / 205 rules
pip-audit SSO dep subgraph 2 real CVEs on pyOpenSSL 22.0.0 — fixed in this PR

Manual review — positive controls confirmed

Area Finding Location
State parameter 256-bit `secrets.token_urlsafe(32)`, single-use, PostgreSQL-backed `provider.py:102-111`
PKCE S256 enforced `oidc.py:39`
id_token signature Verified against JWKS, `alg=none` rejected `oidc.py:84-90`
Standard claims `iss`, `aud`, `exp`, `nbf` validated `oidc.py:93`
SAML assertion signature `want_assertions_signed: True` `saml.py:123`
SAML AuthnRequest signature `authn_requests_signed: True` `saml.py`
Audit logging All SSO outcomes logged via `log_login_event` `sso.py`
Client IP Uses trusted proxy validation `sso.py:38-42`
Encryption at rest Provider configs encrypted via `EncryptionService` `sso.py:50-56`

Deferred findings (follow-up issues filed)

Neither is exploitable given existing controls; both are improvements.

Governance

This review is not a human security sign-off substitute for operational trust decisions:

  • IdP metadata trust (operator responsibility)
  • Role mapping review (per-IdP, per-deployment)
  • Session timeout policy (12h absolute, applies equally to SSO + local auth)

Test plan

remyluslosius and others added 5 commits April 13, 2026 22:43
Q2 governance item: SSO federation security review.

Scan tools:
- Bandit 1.9.4 (high+medium severity): 0 findings
- Semgrep p/security-audit + p/owasp-top-ten + p/jwt + p/python (205 rules): 0 findings
- pip-audit on SSO dependency subgraph: 2 real CVEs in pyOpenSSL 22.0.0
  (transitive via pysaml2)

Fix:
- Pin pyOpenSSL==26.0.0 in requirements.txt
  (fixes CVE-2026-27448, CVE-2026-27459)

Manual review findings (LOW, deferred as follow-ups, not exploitable):
- SEC-SSO-02: OIDC nonce not implemented (mitigated by state + PKCE S256)
- SEC-SSO-03: JWKS fetched on every callback without cache
  (performance + availability)

Confirmed positive controls: 256-bit state, single-use, PostgreSQL-backed;
PKCE S256; id_token signature verification with alg=none rejection;
iss/aud/exp/nbf validation; SAML want_assertions_signed=True;
authn_requests_signed=True; audit logging; trusted proxy for client IP;
provider configs encrypted at rest.

Review document: docs/SSO_SECURITY_REVIEW_2026-04-14.md
Whitelists docs/*_SECURITY_REVIEW_*.md (and OW_SECURITY_ASSESSMENT.md)
in .gitignore so security review artifacts are tracked for audit trail,
matching the existing pattern for OW_SECURITY_ASSESSMENT.md.

Adds SSO_SECURITY_REVIEW_2026-04-14.md documenting the Q2 governance
review per docs/OPENWATCH_Q2_PLAN.md Workstream G residual items.
@remyluslosius remyluslosius merged commit e5068f8 into main Apr 14, 2026
29 checks passed
@remyluslosius remyluslosius deleted the chore/sso-security-review branch April 14, 2026 10:21
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