14-16 Mar 2026
Voltar ao catalogo

NotificationAppService sem [Authorize] e filtragem manual de TenantId

SEC2-08
MediumAchado ConfirmadoSegurancaRodada 2

Descricao

NotificationAppService herda de ApplicationService sem autorizacao base. Filtra manualmente por CurrentTenant.Id. Se CurrentTenant.Id for nulo, retorna notificacoes sem tenant.

Evidencia
`NotificationAppService.cs` linhas 15-16: herda de `ApplicationService`. Linha 29: `.Where(n => n.TenantId == CurrentTenant.Id)`.
Impacto Tecnico

Sem autorizacao explicita. Filtro manual nao usa ABP multitenancy automatico.

Impacto de Negocio

Potencial acesso a notificacoes de outros tenants em contexto host.

Recomendacao

Adicionar [Authorize]. Confiar no filtro automatico de multitenancy do ABP.

Arquivos Afetados

aspnet-core/src/cargo_fleet.Application/Notifications/NotificationAppService.cs
{
  "id": "SEC2-08",
  "title": "NotificationAppService sem [Authorize] e filtragem manual de TenantId",
  "severity": "Medium",
  "type": "achado confirmado",
  "category": "security",
  "description": "`NotificationAppService` herda de `ApplicationService` sem autorizacao base. Filtra manualmente por `CurrentTenant.Id`. Se `CurrentTenant.Id` for nulo, retorna notificacoes sem tenant.",
  "evidence": "`NotificationAppService.cs` linhas 15-16: herda de `ApplicationService`. Linha 29: `.Where(n => n.TenantId == CurrentTenant.Id)`.",
  "technicalImpact": "Sem autorizacao explicita. Filtro manual nao usa ABP multitenancy automatico.",
  "businessImpact": "Potencial acesso a notificacoes de outros tenants em contexto host.",
  "recommendation": "Adicionar `[Authorize]`. Confiar no filtro automatico de multitenancy do ABP.",
  "files": [
    "aspnet-core/src/cargo_fleet.Application/Notifications/NotificationAppService.cs"
  ],
  "pass": 2
}