logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

An Oracle relational database is used to record marks for projects undertaken by students on an MSc course.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Description, Guidelines and Marking Scheme

1. Aim of the Coursework Assignment

This coursework contributes 20% to the overall DKM assessment.

The aim of the Coursework Assignment is to help you learn more about and get experience of security in relational databases.

The assignment is further explained in Section 2. Section 3 explains the marking scheme. Section 4 gives submission instructions. Section 5 explains the penalties for late submissions. Section 6 explains how the College deals with plagiarism. Section 7 provides additional information on learning resources on plagiarism and study skills. Section 8 provides guidance on how to give appropriate references your answers.

 

2. Description of the assignment

An Oracle relational database is used to record marks for projects undertaken by students on an MSc course.

A student first submits a project proposal which is marked out of 100 by 2 or more examiners whose marks are combined by taking the average, rounded to the nearest whole mark, to give the mark for the proposal. Similarly, a student subsequently submits a project report which is also marked by 2 or more examiners whose marks are combined by taking the average, rounded to the nearest whole mark, to give the mark for the report. The overall project mark is calculated by combining the proposal mark (20%) and report mark (80%) and rounding to the nearest whole mark.

The database includes tables created as follows:

PROJ_EXAMINERS (EXAMINER)

PROJ_DETAILS (STUDENT, TITLE, SUPERVISOR) PROJ_PROPOSAL_EXAMINER_MARKS (STUDENT, EXAMINER, MARK, YEAR) PROJ_REPORT_EXAMINER_MARKS (STUDENT, EXAMINER, MARK, YEAR)

 

A row is stored in PROJ_EXAMINERS for each staff member who is permitted to examine projects, for example ('ADA').

 

A row is stored in PROJ_DETAILS for each project recording the student, project title and supervisor, for example ('MARY01', 'concurrency visualisation tool', 'ADA').

 

For each project, examiners are appointed consisting of the supervisor and one or more other examiners. Rows in PROJ_PROPOSAL_EXAMINER_MARKS and PROJ_REPORT_EXAMINER_MARKS record the marks awarded by examiners for the proposal and report respectively, together with the year the project is examined. Marks are initially NULL. So, for example, assuming that in 2019 for student MARY01 examiners JAMES and GRACE are appointed together with the supervisor ADA, the following rows would be inserted into both

 PROJ_PROPOSAL_EXAMINER_MARKS and PROJ_REPORT_EXAMINER_MARKS:

('MARY01', 'ADA', NULL, 2019)

('MARY01', 'JAMES', NULL, 2019)

('MARY01', 'GRACE', NULL, 2019)

 

The NULL values are updated with the examiners’ marks once they are known.

 

Values stored for STUDENT and EXAMINER are the Oracle usernames of students and examiners respectively.

 

Tables with example rows may be accessed as:

 

PROJ_EXAMINERS PROJ_DETAILS

PROJ_PROPOSAL_EXAMINER_MARKS PROJ_REPORT_EXAMINER_MARKS

 

Task 1: Security

 

An application developer has written an SQL statement to be used within a host language as described in the handout Host Language Support for SQL. The developer wishes to give students access to rows in PROJ_DETAILS so that they can check that their project details are correctly recorded, but not the project details of other students.

 

The application asks the student to enter their Oracle username which is stored in a variable username. The application then builds a string in a variable querystring for the SQL query to be executed by concatenating:

 

SELECT TITLE, SUPERVISOR FROM PROJ_DETAILS WHERE STUDENT = '

The name entered and stored in username

If, for example, the student enters MARY01 as their username, the application builds a querystring

SELECT TITLE, SUPERVISOR FROM PROJ_DETAILS WHERE STUDENT = 'MARY01'

which it then prepares with

 

EXEC SQL PREPARE QUERY_STMT FROM :querystring;

before processing with a cursor in the normal way to enable the application to handle the result rows.

 

A common form of attack against databases is by exploiting SQL injection techniques in applications. See: https://www.owasp.org/index.php/SQL_Injection

 

Explain in your own words (1500-2000 words in total):

 

(a) Explain what an SQL injection attack is and discuss the problems which this can cause.

(12 marks)

 

(b) Explain, giving two examples specific to the schema described, how the application outlined could lead to an SQL injection attack.

(8 marks)

 

(c) The application is clearly vulnerable in any case to a user guessing or knowing another student’s username. If user passwords were also stored in the database, and the user entered a password as well as a username with the querystring built to test for both in the WHERE clause, would SQL injection attacks be prevented? Explain your answer and give an example specific to the schema described. (8 marks)

(d) How can such attacks be guarded against by more careful use of prepared statements when building applications which use SQL from a host language? Illustrate your answer with the changes you would make to the SQL statements of the application outlined above.

(16 marks)

Task 2: Views

 

Views are an additional mechanism which can help support secure access to table data when used with appropriate privileges. The following views are proposed to control the data visible to different Oracle users when logged on to Oracle.

 

Give the SQL statements for the creation of views in Oracle to support these requirements.

 

Note that in Oracle you may reference the function USER in an SQL statement, for example in a SELECT or WHERE clause. It returns the username of the person executing the SQL statement. Also, a function ROUND(n,1) returns n rounded to one decimal place.

 

(a) One view is required with the same columns as PROJ_DETAILS which gives access to all rows to staff permitted to examine projects, but gives students access to only the row for their own project. (16 marks)

 

(b) Two views are required summarising the project proposal marks and project report marks obtained by combining the individual examiners’ marks:

 

PROJ_PROPOSAL_MARKS (YEAR, STUDENT, MARK) PROJ_REPORT_MARKS (YEAR, STUDENT, MARK)

For example, a row in PROJ_PROPOSAL_MARKS (2019, 'NEIL01' 62)and a row in PROJ_REPORT_MARKS(2019, 'NEIL01' 57)record that NEIL01 had his project examined in 2019 with proposal mark 62 and report mark 57.

 

Only projects which have all proposal marks recorded should be included in PROJ_PROPOSAL_MARKS while only projects which have all report marks recorded should be included in PROJ_REPORT_MARKS.

 

Rows in each view should be accessible by staff permitted to examine projects but a student should only have access to rows for their own project. (24 marks)

 

(c) One view is required summarising the overall project marks in each year

PROJ_OVERALL_MARKS (YEAR, STUDENT, PROPOSAL_MARK,

REPORT_MARK, PROJECT_MARK)

which summarises the marks for the proposal, report and overall project mark each year. So, for NEIL01, a row for his project result in 2019 should be recorded:

(2019, 'NEIL01' 62, 57, 58)

Rows in the view should be accessible by staff permitted to examine projects but a student should only have access to the row for their own project. (16 marks)

3. Marking Scheme

Marks will be allocated as shown in the description of the task. The total possible mark is 100.

For Task 1, marks will be awarded for correctness, clarity, originality and depth of understanding demonstrated in the answer.

For Task 2, full marks will be given for fully correct solutions. Otherwise marks will be awarded for partially correct aspects of the solution.

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

730 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

655 Answers

Hire Me
expert
Husnain SaeedComputer science

923 Answers

Hire Me
expert
Atharva PatilComputer science

737 Answers

Hire Me
August
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
6
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30