Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RESIDENCE guild show #126

Open
1 task done
matheusjp2 opened this issue Dec 18, 2024 · 1 comment
Open
1 task done

RESIDENCE guild show #126

matheusjp2 opened this issue Dec 18, 2024 · 1 comment

Comments

@matheusjp2
Copy link

Priority

Critical

Area

System

What OS are you seeing the problem on?

Linux

Browser

Edge

What happened?

a função residence em show.php pode ser vulnerável a SQL Injection e também pode causar problemas se a variável $guild_residence estiver vazia ou contiver caracteres especiais.
https://github.com/opentibiabr/myaac/blob/main/system/pages/guilds/show.php#L114

correção.
// RESIDENCE
$guild_residence = $guild->getCustomField('residence');

// Preparar e executar a primeira consulta
$select_guildhouse = $db->prepare('SELECT house_id, listid, list FROM house_lists WHERE house_id = :house_id');
$select_guildhouse->execute(['house_id' => $guild_residence]);
$get_guildhouse = $select_guildhouse->fetch();
$count_guildhouse = $select_guildhouse->rowCount();

if ($count_guildhouse > 0) {
// Preparar e executar a segunda consulta
$get_house = $db->prepare('SELECT id, owner, paid, name, town_id FROM houses WHERE id = :id');
$get_house->execute(['id' => $get_guildhouse['house_id']]);
$house = $get_house->fetch();
$house_name = $house['name'];
}

Code of Conduct

  • I agree to follow this project's Code of Conduct
@FelipePaluco
Copy link

faz o PR pra nos lindeza

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants