Procedure 2. Search.
Input:
year year of the academic course,
Output:
b HTML table
1.
CREATE PROCEDURE
`security`.`teaching` (in year varchar(100), out
b text)
…
2.
select courses.name from
courses inner join courses_year on
courses.id=courses_year.id
where courses_year.year=year;
In case of an attempt of injecting malicious code
in the search field by the following statement
2015 union select username from
users
then the procedure will create a syntactically wrong
SQL instruction equivalent to the following
select courses.name from courses
inner join courses_year on
courses.id = courses_year.id
where courses_year.year =
‘2015 union select username
from users’.
Notice that the data type of the input parameter is
varchar in this ad hoc example (line 1). Had we
used the correct data type, that is year, we would
have obtained a data truncation error.
Moreover, assuming to create a syntactically
correct SQL instruction, the user will not be able to
view the data, because s/he does not have the
necessary privileges on the users table.
5 CONCLUSIONS
In this paper, we have presented an approach to
improve database security that is a current threat to
web-based environments. In fact, the system security
is always entrusted to web developers who must
implement all the necessary input validation in order
to ensure system invulnerability.
Our approach is based on a replication of user
accounts at DBMS level such that the personal
account of a given user is used to connect to the
DBMS instead of a common password, stored as
plain text. In this context, web resources, such as
web pages, are mapped to database resources, such
as procedures managing further resources that are
external views.
The assumption is that a user may pass the
application’s controls, but that user will never be
able to access data anyway, if he/she is not granted
the necessary privileges.
Future work is devoted to a benchmark between
the traditional data flow and our approach, as we
believe that the creation of an HTML object is faster
when using a cursor to scan a table at DBMS level
than fetching rows at application level.
REFERENCES
Ben Natan, R., 2005. Implementing Database Security and
Auditing. Elsevier Digital Press.
Bertino, E., and Sandhu, R., 2005. Database security -
Concepts, Approaches, and Challenges, IEEE
Transactions on Dependable and Secure Computing,
vol. 2, issue 1, pp. 2-19.
Boyd, S. W., and Keromytis, A. D., 2004. SQLrand:
Preventing SQL Injection Attacks, Applied
Cryptography and Network Security, Lecture Notes in
Computer Science, vol. 3089, pp. 292-302.
Gertz, M., and Jajodia, S., 2007. Handbook of Database
Security: Applications and Trends, Springer, 1 edition.
Halfond, W. G. J., Viegas, J., and Orso, A., 2006. A
Classification of SQL Injection Attacks and
Countermeasures, Proceedings of the IEEE
International Symposium on Secure Software
Engineering, Arlington, VA, USA.
Huang, Y-W, Huang, S-K., Lin, T-P., and Tsai, C-H.,
2003. Web Application Security Assessment by Fault
Injection and Behavior Monitoring, Proceedings of the
12th International Conference on World Wide Web,
Budapest, Hungary, pp. 148-159.
Jiangtao Li, Ninghui Li, XiaoFeng Wang, Ting Yu, 2009.
Denial of Service Attacks and Defenses in
Decentralized Trust Management, International
Journal of Information Security vol. 8, issue 2, pp.89-
101.
Pinzón, C., De Paz, J. F., Bajo, J., Herrero, A., and
Corchado, E., 2010. AIIDA-SQL: An Adaptive
Intelligent Intrusion Detector Agent for Detecting SQL
Injection Attacks, 10th International Conference on
Hybrid Intelligent Systems (HIS), pp. 73-78.
Rietta, F. S., 2006. Application Layer Intrusion Detection
for SQL Injection, Proceedings of the 44th Annual
Southeast Regional Conference, Melbourne, Florida,
pp. 531-536.
Roy, S., Kumar Singh, A., and Singh Sairam, A., 2011.
Analyzing SQL Meta Characters and Preventing SQL
Injection Attacks Using Meta Filter, 2011
International Conference on Information and
Electronics Engineering, IPCSIT vol. 6, pp. 167-170.
Vasserman, E. Y., Hopper, N., and Tyra, J., 2009.
SilentKnock: Practical, Provably Undetectable