Skip to content

nico-api Admin UI needs CSRF protection #3502

Description

@kensimon

Version

main

Describe the bug.

It looks like we're not doing any CSRF validation in the admin UI, token-based or otherwise.

It looks like recent tower-http versions have a csrf feature we can enable: https://docs.rs/tower-http/latest/tower_http/csrf/index.html ... we'd just want to make sure to carve out the right settings for the oauth2 callback routes since they have certain expected cross-site characteristics.

Otherwise we could look at adding a simple middleware layer that checks for Sec-Fetch-Site on the admin-ui and rejects it if it's not none or same-origin.

Code of Conduct

  • I agree to follow NVIDIA Infra Controller's Code of Conduct
  • I have searched the open bugs and have found no duplicates for this bug report

Metadata

Metadata

Assignees

Labels

bugA defect in existing software (deprecated - use issue type, but it's needed for reporting now)

Type

Fields

No fields configured for Bug.

Projects

Status
In Progress

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions