1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] 1/0 don't cause the zero division error in SQL

Discussão em 'Outras Linguagens' iniciado por Stack, Setembro 27, 2024 às 14:32.

  1. Stack

    Stack Membro Participativo

    I was reading PortSwigger sql-injections guide and they said that 1/0 can cause ZeroDevision error. But in reality I've got no errors when trying to induce SQL compiler to carry out zero division

    MariaDB [test]> SELECT * FROM user;
    +---------------+----------+
    | username | password |
    +---------------+----------+
    | administrator | 12345 |
    | dave | qwerty |
    +---------------+----------+
    2 rows in set (0.000 sec)

    MariaDB [test]> SELECT IF(LENGTH(username)=4,1/0,1) FROM user;
    +------------------------------+
    | IF(LENGTH(username)=4,1/0,1) |
    +------------------------------+
    | 1.0000 |
    | NULL |
    +------------------------------+
    2 rows in set, 1 warning (0.000 sec)


    How can you explain this?

    I was trying this in different DBs and the result is the same portswigger guide passage

    Continue reading...

Compartilhe esta Página