SQL injection in ORACLE insert statements

Source: Internet
Author: User

Log by kj021320 08.6.22

As we all know, ORACLE does not support multi-statement operations by using symbols.

Is SQL injection a weakness during insert?

Some time ago, I saw an access version of sqlinjection in a forum appear in the insert field. Then I went back and forth to test it several times and found it was difficult to take advantage of it.

When I conducted the DBA training today, I did the test on hand. I was surprised to see the following sqlplus record.

SQL & gt; create table inserttable (n varchar2 (100 ));

The table has been created.

SQL> insert into inserttable (n) values (select user from dual ));

One row has been created.

SQL> select * from inserttable;

N -------------------- KJ

SQL> rollback;

Rollback completed.

SQL> insert into inserttable (n) values (select a from test); insert into inserttable (n) values (select a from test) * row 1st error: ORA-01427: a single row subquery returns multiple rows

SQL> spool off

Very useful

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.