Ir al contenido

Assert For Auth Control (ARCH9133)

Esta página aún no está disponible en tu idioma.

Key swift.security.assert-for-auth-control · Severity warning · Category security · CWE CWE-617

Flags assert() / assertionFailure used for authorization checks - assertions are compiled out in release builds.

assert(user.isAdmin)
guard user.isAdmin else { throw Abort(.forbidden) }

Enforce with a guard that always runs.