CWE-283 Base Rascunho

Unverified Ownership

This vulnerability occurs when an application fails to confirm that a user has legitimate ownership rights to a sensitive resource before allowing them to perform actions on it.

Definição

What is CWE-283?

This vulnerability occurs when an application fails to confirm that a user has legitimate ownership rights to a sensitive resource before allowing them to perform actions on it.
At its core, this flaw is about broken authorization. The application might check if a user is authenticated but then skips the crucial second step: verifying that the specific data or function they're trying to access actually belongs to them. This often happens when developers use an identifier from the client (like an ID in a URL, form field, or cookie) to directly fetch or modify a database record without first checking if the current session is authorized for that exact record. Exploiting this weakness is a primary goal for attackers, leading directly to data breaches and privilege escalation. For example, by simply changing a number in a URL parameter, an attacker could view another user's private messages, financial details, or administrative panels. To prevent this, every single request for a user-specific resource must be validated against the current session's ownership rights, ensuring the user is only ever acting upon resources they truly own.
Impacto no mundo real

Real-world CVEs caused by CWE-283

  • Program does not verify the owner of a UNIX socket that is used for sending a password.

  • Owner of special device not checked, allowing root.

Como os atacantes a exploram

Trajeto do atacante passo a passo

  1. 1

    This function is part of a privileged program that takes input from users with potentially lower privileges.

  2. 2

    This code does not confirm that the process to be killed is owned by the requesting user, thus allowing an attacker to kill arbitrary processes.

  3. 3

    This function remedies the problem by checking the owner of the process before killing it:

Exemplo de código vulnerável

Vulnerable Python

This function is part of a privileged program that takes input from users with potentially lower privileges.

Vulnerável Python
def killProcess(processID):
  	os.kill(processID, signal.SIGKILL)
Exemplo de código seguro

Secure Python

This function remedies the problem by checking the owner of the process before killing it:

Seguro Python
def killProcess(processID):
  		user = getCurrentUser()
```
#Check process owner against requesting user* 
  		if getProcessOwner(processID) == user:
  		```
  			os.kill(processID, signal.SIGKILL)
  			return
  		else:
  			print("You cannot kill a process you don't own")
  			return
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Lista de verificação de prevenção

How to prevent CWE-283

  • Architecture and Design / Operation Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
  • Architecture and Design Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.
Sinais de deteção

How to detect CWE-283

SAST High

Executar análise estática (SAST) na base de código à procura do padrão inseguro no fluxo de dados.

DAST Moderate

Executar testes dinâmicos de segurança de aplicações (DAST) contra o endpoint em execução.

Runtime Moderate

Monitorizar os registos em tempo de execução para traços de exceção invulgares, input malformado ou tentativas de contornar a autorização.

Code review Moderate

Revisão de código: sinalizar qualquer novo código que trate input desta superfície sem usar os ajudantes validados do framework.

Correção automática do Plexicus

O Plexicus deteta automaticamente o CWE-283 e abre um PR de correção em menos de 60 segundos.

O Codex Remedium analisa cada commit, identifica esta fraqueza exata e entrega um pull request pronto para revisão com o patch. Sem tickets. Sem transferências.

Perguntas frequentes

Frequently asked questions

O que é o CWE-283?

This vulnerability occurs when an application fails to confirm that a user has legitimate ownership rights to a sensitive resource before allowing them to perform actions on it.

Qual a gravidade do CWE-283?

A MITRE não publicou uma classificação de probabilidade de exploração para esta fraqueza. Trate-a como impacto médio até o seu modelo de ameaças provar o contrário.

Que linguagens ou plataformas são afetadas pelo CWE-283?

A MITRE não especificou as plataformas afetadas por este CWE — pode aplicar-se à maioria das stacks de aplicações.

Como posso prevenir o CWE-283?

Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software. Consider following the principle of separation of privilege. Require multiple conditions to be met before permitting access to a system resource.

Como é que o Plexicus deteta e corrige o CWE-283?

O motor SAST do Plexicus correlaciona a assinatura de fluxo de dados do CWE-283 em cada commit. Quando é encontrada uma correspondência, o nosso agente Codex Remedium abre um PR de correção com o código corrigido, testes e um resumo de uma linha para o revisor.

Onde posso saber mais sobre o CWE-283?

A MITRE publica a definição canónica em https://cwe.mitre.org/data/definitions/283.html. Pode também consultar a documentação da OWASP e do NIST para orientações adjacentes.

Pronto quando você estiver

Pare de pagar por desenvolvedor.
Comece a fechar o ciclo.

O Plexicus é o ASPM nativo de IA que verifica, filtra, corrige, pentesta e explica — de forma autónoma. Programadores ilimitados, repos ilimitados, ações de IA de utilização justa. Nível gratuito real, €269/mo anual quando estiver pronto.