Python Forum
Database Submit Entry Syntax Error
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database Submit Entry Syntax Error
#8
@buran that is true we were supposed to be discussing that code snippet and again this piece of code you give has exactly the same issue with injection attacks as the one I gave but yours does not allow for easy validation of the SQL statement prior to using it where mine does.
c.execute("INSERT INTO Expense_Data.db VALUES (?, ?, ?, ?)", (l1.get(), l2.get(), l3.get(), l4.get()))

Further I do mine the way I do based on how I have set up my MVC Database Class handler where the SQL statement to be used is a Class Variable that gets built by the stored procedure and the SELECT, INSERT, DELETE, UPDATE all get handled by 2 generic database calls

Okay now on to explaining what buran means by injection attacks since buran chose not to explain it at all...

Quote:Attackers can use SQL Injection vulnerabilities to bypass application security measures. They can go around authentication and authorization of a web page or web application and retrieve the content of the entire SQL database. They can also use SQL Injection to add, modify, and delete records in the database.

What are these vulnerabilities basically if coded properly and put into a variable that is getting concatenated to a SQL statement without prior validation one could input a SQL Query that did many things such as send the entire contents of you database to a remote location. Or completely delete permanently the entire contents of your database or insert a trigger that secretly sends all data activity to some remote location and the list goes on. So when receiving data from a user or any other external source is it extremely important to validate that data prior to allow it to be used. This of course should actually occur at the point of reception which makes those inline get calls (above) twice as dangerous since they leave no room for validation.
Reply


Messages In This Thread
Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 03:02 AM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 05:10 AM
RE: Database Submit Entry Syntax Error - by Denni - Jan-22-2020, 03:11 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 03:12 PM
RE: Database Submit Entry Syntax Error - by Denni - Jan-22-2020, 03:19 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 03:20 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 03:23 PM
RE: Database Submit Entry Syntax Error - by Denni - Jan-22-2020, 03:35 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 03:40 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 03:47 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 04:04 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 04:08 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 04:13 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 05:04 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 05:08 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 05:28 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 05:41 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 05:41 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 05:50 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 05:55 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 07:21 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 07:29 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 07:40 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-22-2020, 07:41 PM
RE: Database Submit Entry Syntax Error - by Melford - Jan-22-2020, 07:49 PM
RE: Database Submit Entry Syntax Error - by Denni - Jan-22-2020, 09:28 PM
RE: Database Submit Entry Syntax Error - by buran - Jan-23-2020, 04:15 AM
RE: Database Submit Entry Syntax Error - by Denni - Jan-27-2020, 04:20 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [Tkinter] Error verify data in database TomasSanchexx 2 1,918 Aug-11-2023, 12:37 PM
Last Post: TomasSanchexx
  [PyGUI] Invalid command error with Entry object eliqm 8 5,855 May-18-2023, 10:14 PM
Last Post: eliqm
  [Tkinter] Trying to add data into a shelf from a submit button TWB 8 3,777 Jan-06-2023, 11:30 PM
Last Post: TWB
  Usborne Coding for Beginners using Python 'Dodge the Bombs' Syntax Error CMSheWolfe 5 5,775 Jun-18-2020, 09:41 PM
Last Post: deanhystad
  Transfer Toplevel window entry to root window entry with TKinter HBH 0 5,335 Jan-23-2020, 09:00 PM
Last Post: HBH
  Problem with Submit button Tkinter Reldaing 2 4,737 Jan-05-2020, 01:58 AM
Last Post: balenaucigasa
  [Tkinter] how to get the entry information using Entry.get() ? SamyPyth 2 4,456 Mar-18-2019, 05:36 PM
Last Post: woooee

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020