Dynamic Selector (ARCH9132)
Esta página aún no está disponible en tu idioma.
Key swift.security.dynamic-selector · Severity warning · Category security · CWE CWE-470
Flags NSSelectorFromString / perform(Selector(...)) driven by untrusted data.
Incorrect
Section titled “Incorrect”perform(NSSelectorFromString(request.action))Correct
Section titled “Correct”let handlers: [String: () -> Void] = [...]handlers[request.action]?()Look the name up in an explicit allow-list.