14-16 Mar 2026
Voltar ao catalogo

CORS AllowAnyOrigin hardcoded no AuthServer (sem condicional por ambiente)

SEC2-12
MediumAchado ConfirmadoSegurancaRodada 2

Descricao

AuthServer tem AllowAnyOrigin() configurado diretamente no codigo C# sem condicional por ambiente.

Evidencia
`cargo_fleetAuthServerModule.cs` linhas 204-215: `builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()`.
Impacto Tecnico

Superficie de ataque ampliada no servidor de autenticacao. Combinado com Password Grant, vetor para token harvesting.

Impacto de Negocio

CSRF e token harvesting facilitados no AuthServer.

Recomendacao

Restringir CORS no AuthServer a acesso.cargofleet.app.br. Ler origens de configuracao.

Arquivos Afetados

aspnet-core/src/cargo_fleet.AuthServer/cargo_fleetAuthServerModule.cs

Acoes Relacionadas

{
  "id": "SEC2-12",
  "title": "CORS AllowAnyOrigin hardcoded no AuthServer (sem condicional por ambiente)",
  "severity": "Medium",
  "type": "achado confirmado",
  "category": "security",
  "description": "AuthServer tem `AllowAnyOrigin()` configurado diretamente no codigo C# sem condicional por ambiente.",
  "evidence": "`cargo_fleetAuthServerModule.cs` linhas 204-215: `builder.AllowAnyOrigin().AllowAnyHeader().AllowAnyMethod()`.",
  "technicalImpact": "Superficie de ataque ampliada no servidor de autenticacao. Combinado com Password Grant, vetor para token harvesting.",
  "businessImpact": "CSRF e token harvesting facilitados no AuthServer.",
  "recommendation": "Restringir CORS no AuthServer a `acesso.cargofleet.app.br`. Ler origens de configuracao.",
  "files": [
    "aspnet-core/src/cargo_fleet.AuthServer/cargo_fleetAuthServerModule.cs"
  ],
  "pass": 2,
  "relatedActions": [
    "ACT-5.1.4"
  ],
  "relatedFindings": [
    "CRIT-04"
  ]
}