Consider the following Python program #dbuser and dbpwd are obtained from a # configuration file con...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following Python program #dbuser and dbpwd are obtained from a # configuration file con = pymysql.connect('localhost', dbuser, dbpwd, 'database') # get parameters from web request uid = getRequest Parameter("uid") with con: cur = con.cursor() Python cur.execute("SELECT * FROM users WHERE user_id=" + uid) firstname, lastname = cur.fetchone () print("Welcome " + firstname + " " + lastname) (i) What vulnerability does this program have? Briefly explain the vulnerability in general and, in particular, why this program is vulnerable. DO (ii) Modify this program to fix the vulnerability. (iii) Briefly explain why your modified version is secure. Consider the following Python program #dbuser and dbpwd are obtained from a # configuration file con = pymysql.connect('localhost', dbuser, dbpwd, 'database') # get parameters from web request uid = getRequest Parameter("uid") with con: cur = con.cursor() Python cur.execute("SELECT * FROM users WHERE user_id=" + uid) firstname, lastname = cur.fetchone () print("Welcome " + firstname + " " + lastname) (i) What vulnerability does this program have? Briefly explain the vulnerability in general and, in particular, why this program is vulnerable. DO (ii) Modify this program to fix the vulnerability. (iii) Briefly explain why your modified version is secure.
Expert Answer:
Answer rating: 100% (QA)
Vulnerability in the Python program The Python program is vulnerable to SQL injectionSQL injection is a type of injection attack that allows an attacker to interfere with the queries that an applicati... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
The TGF Care Facility (TGF) is a not- for- profit organization dedicated to providing services in the care and rehabilitation of seniors with physical or mental disabilities. The main programs are...
-
In Problem 10.16, we projected financial statements for Walmart Stores for Years +1 through +5. The data in Chapter 12s Exhibits 12.1612.18 include the actual amounts for 2008 and the projected...
-
A child on a sled (total mass m) starts from rest at the top of a hill of height h and slides down. Does the velocity at the bottom depend on the angle of the hill if (a) It is icy and there is no...
-
Describe some techniques that car salespeople might use in negotiating the price of the car. What should you be aware of at no-haggle dealerships?
-
Mind & Motion entered into a real estate purchase contract (REPC) with Celtic Bank to buy a large piece of the banks foreclosed property. Although the county had approved plans to construct...
-
The management of Red Robin Co. is reevaluating the appropriateness of using its present inventory cost flow method, which is average-cost. They request your help in determining the results of...
-
Calculate Inventory Conversion Period, Receivables Conversion Period, the Payment Conversion Period, and the Operating Cycle for Innovation Inc. given the following information. Use 365 to get an...
-
The following information, taken from the books of Herman Brothers Manufacturing represents the operations for January: The job cost system is used, and the February cost sheet for Job M45 shows the...
-
For each country, identify the best International Monetary System Exchange Rate Regime classification by choosing ONE of the following for each country. Hint: A regime is used one time only. Soft...
-
A simple trust has one beneficiary and in the current year has interest income of 8,000.00, tax exempt interest of$6,000.00, c/g income of$4,000 and fiduciary fees expense of $2,000.00 (allocable to...
-
A 10-kg hammer strikes a nail at a velocity of 5.0 m/s and comes to rest in a time interval of 7.0 ms Part A What is the impulse given to the nail? Express your answer using two significant figures....
-
Rutting of asphalt pavement is a phenomenon that the pavement deformation increases with time under the same vehicle loading, usually under heavy, often slow-moving loading. A laboratory...
-
1. _____ modifies MAC addresses in the ARP cache, so that network traffic goes from the victim's computer, through the attackers computer, and then to the destination computer. A. MAC cloning...
-
Dima is a single and 39 years old has four children, ages 4, 5, 7, and 11. Assuming Dima's gross income for 2019 is $280,000. Dima's deductions for AGI is $40,000 and has no other deductions. What is...
-
Sheffield Company has an old factory machine that cost $ 57,000 . The machine has accumulated depreciation of $ 31,920 . Sheffield has decided to sell the machine. (Credit account titles are...
-
Use multiplication or division of power series to find the first three nonzero terms in the Maclaurin series for each function. y = e x2 cos x
-
During 2012, Tom sold Sears stock for $10,000. The stock was purchased 4 years ago for $13,000. Tom also sold Ford Motor Company bonds for $35,000. The bonds were purchased 2 months ago for $30,000....
-
Rebecca and Walter Bunge have been married for 5 years. They live at 883 Scrub Brush Street, Apt. 52B, Las Vegas, NV 89125. Rebecca is a homemaker and Walt is a high school teacher. Rebecca's Social...
-
Jerry made the following contributions during 2012: His synagogue (by check).....................................................$680 The Democratic Party (by check)...
-
Go to http://management.about.com/lr/project_time_ management/174690/1/ and click on Project Management on the left side of the screen. When you consider several of the articles on time management in...
-
Consider the following information that you have compiled regarding the steps needed to complete a project. You have identified all relevant steps and have made some determinations regarding...
-
Key in a search with the prompt projects in in which you select a country of interest (e.g., projects in Finland). Many of the projects generated by such a search are government-sponsored...
Study smarter with the SolutionInn App