Secure PL SQL Coding
Secure PL SQL Coding
C
Copyright
i ht © 2012 b
by P
PeteFinnigan.com
t Fi i Li
Limited
it d
No part of this publication may be stored in a retrieval system, reproduced or transmitted in any form by any means, electronic, mechanical, photocopying,
scanning, recording, or otherwise except as permitted by local statutory law, without the prior written permission of the publisher. In particular this material may
not be used to provide training or presentations of any type or method. This material may not be translated into any other language or used in any translated
form to provide training or presentations.
presentations Requests for permission should be addressed to the above registered address of PeteFinnigan
PeteFinnigan.comcom Limited in writing
writing.
Limit of Liability / Disclaimer of warranty. This information contained in this material is distributed on an “as-is” basis without warranty.
Whilst every precaution has been taken in the preparation of this material, neither the author nor the publisher shall have any liability to any person or entity
with respect to any loss or damage caused or alleged to be caused directly or indirectly by the instructions or guidance contained within this course.
TradeMarks. Many of the designations used by manufacturers and resellers to distinguish their products are claimed as trademarks. Linux is a trademark of
Linus Torvalds, Oracle is a trademark of Oracle Corporation. All other trademarks are the property of their respective owners. All other product names or
services identified throughout the material are used in an editorial fashion only and for the benefit of such companies with no intention of infringement of
the trademark. No such use, or the use of any trade name, is intended to convey endorsement or other affiliation with this material.
• History
• Common attacks on PL/SQL
• Example Hack! – keep in real
• Secure coding in PL/SQL
• Protecting PL/SQL
• Addingg license features in PL/SQL
History
• Oracles alerts and CPU’s have been littered with
PL/SQL bugs
• Oracle started to fix their bugs
• Oracle test their code (Fuzz, static analysis, manual
audit)
• Oracle train their developers in secure coding
• http://www.petefinnigan.com/weblog/archives/00001153.
htm
• DBMS_ASSERT
DBMS ASSERT used d extensively
t i l plus
l bi
binds
d ffor
dynamic code with database objects (not “objects” but
tables etc)
© Copyright 2012 PeteFinnigan.com Limited. All rights reserved. , http://www.petefinnigan.com 5
What About Customer Code?
• Oracle have fixed hundreds (more?) PL/SQL bugs
• They have training, tools, testing, standards and more
• BUT usually we have not!
• We are 10 years behind Oracle in PL/SQL secure coding
• Most likely
• We have simple security bugs not found in Oracle code now
• We use dangerous interfaces
• We don’t check/audit/test our code for security issues
• We create open DML/DDL/SQL interfaces
• Not good!
8 rows selected.
SQL>