SlideShare a Scribd company logo
Security in Firebird:  2.1, 2.5, 3.0 Alex Peshkov (peshkoff at mail.ru)
First years of InterBase In order to understand security problems of Firebird, we should consider historical issues At that time there was another approach to database and server security
First years of InterBase 1984 – hardware and software was not like today No Internet like we see it today  Hardware (PDP11, VAX11) requirements to run RDBMS Multiuser mode is 'many processes', not 'many threads' – relatively safe even in case of buffer overflow
First years of InterBase No strong requirements to RDBMS security No abilities to support strong requirements even if they presented -- as the result -- Lot of small buffers without overflow control External tables and UDFs – one can store any data as external table and call as UDF 'root' runuser RDBMS is anyway safe!
Approach to security in Borland 1992-1993: Windows 3.X port Need to have own users list – database isc4.gdb Access to it from server itself for authentication purposes (use of login 'politically' and password 'correct' for it)‏ Local access protocol using Windows events (PostEvent(), etc.)‏
Windows NT (95) port Use of multi-thread access model instead of mutli-process No buffers' size review (!) No integration between own users list and host OS accounts Local protocol is still using Windows Events Runs as LocalSystem account Borland security solutions for InterBase
Firebird security development Year 2002: 1.0 Fixed serious vulnerability was eliminated  “ politically correct” left the building Assessment of the most dangerous places in firebird code base
Firebird security development Year 2004: 1.5 Fixed vulnerabilities: 'root' (LocalSystem) server execution (in Windows – prevents use of local access protocol)‏ Arbitrary code execution using standard SQL language tools (External Table + UDF)‏ Access to any database as a 'raw' file Some buffers overflows
Firebird security development Year 2006: 2.0 Fixed vulnerabilities: More buffers overflows fixed Ability to read passwords' hashes from security database using any valid login Started code review in order to completely avoid buffer overflows in strings (file names, etc.)‏ New feature: User can change own password (only superuser could change any password before)‏
Firebird 2.1- what's new Fixed vulnerability: Finished buffers overflow hunting – no new bugreports during last year. New feature: Use Windows trusted authentication to login to Firebird server
Firebird 2.1: windows trusted authentication Authentication using own security database Client Server Attach Accept (or reject)‏
Firebird 2.1: windows trusted authentication Using windows trusted authentication Client Server ...... May require passing data between client and server many times. Use native authentication API Attach trusted Request to adjust security contex Adjusted security context Accept (or reject)‏
Traditional authentication  (client)‏ fbclient library isc_dpb_user_name isc_dpb_password ......... Environment variables isc_dpb_user_name isc_dpb_password ......... Login/password may be picked up from environment by client library ISC_USER=..
Traditional authentication  (server)‏ Network listener Database engine Validation  in security database isc_dpb_user_name isc_dpb_password ......... isc_dpb_user_name isc_dpb_password Validation is performed by DB engine
Trusted authentication (client)‏ isc_dpb_trusted ......... ......... ......... Environment variables fbclient library Client library automatically adds trusted auth request to DPB
Trusted Authentication (client)‏ ......... ......... isc_dpb_user_name isc_dpb_password ......... Environment variables fbclient library Login is picked up from environmnet (backward compatibility)‏ ISC_USER=..
Trusted Authentication (client)‏ isc_dpb_trusted isc_dpb_trusted ......... ......... Environment variables fbclient library Adding isc_dpb_trusted by application to force trusted auth. ISC_USER=..
Trusted Authentication (server)‏ isc_dpb_trusted Network listener .......... isc_dpb_trusted ......... DB engine Host OS validation (callback)‏ Network listener does all work, on success puts internal tag into DPB.
Trusted Authentication (server)‏ isc_dpb_trusted Network listener .......... isc_dpb_trusted ......... isc_dpb_trusted Host OS validation (callback)‏ DB engine Safe - network listener removes extra isc_dpb_trusted tags from DPB
Firebird 2.5 - what's new Fixed vulnerabilities Attack on server using large packets with garbage New features User management in SQL (CREATE / ALTER / DROP USER)‏ System role RDB$ADMIN Configure mapping of domain administrators to RDB$ADMIN role using SQL New GRANTED BY clause in GRANT and REVOKE operators
Firebird 2.5 - what's new User management in SQL CREATE USER name PASSWORD 'pw' FIRSTNAME 'first' MIDDLENAME 'middle' LASTNAME 'last' ALTER USER name PASSWORD 'pw' FIRSTNAME 'first' MIDDLENAME 'middle' LASTNAME 'last' DROP USER name
Firebird 2.5 - what's new User management in SQL In firebird 2.5 this commands always work with common security database security2.fdb Alter User <Current_user> is available for all users, the rest – only to SYSDBA
Firebird 2.5 - what's new System role RDB$ADMIN GRANT “RDB$ADMIN” TO GUEST1 When attaching to current database with role RDB$ADMIN user GUEST1 will have all rights of database administrator (SYSDBA)‏ REVOKE “RDB$ADMIN” FROM GUEST1
Firebird 2.5 - what's new Configure mapping of domain administrators to RDB$ADMIN role using SQL ALTER ROLE RDB$ADMIN SET / DROP AUTO ADMIN MAPPING This is restricted form of a command, planned to control mapping of host OS objects to database objects in firebird 3
Firebird 2.5 - what's new New GRANTED BY clause in GRANT and REVOKE operators Makes it possible for SYSDBA to revoke rights, granted by other users
Firebird 2.5 - what's new sysdba: CREATE ROLE role1; GRANT role1 TO user1 WITH ADMIN OPTION; user1: GRANT role1 TO PUBLIC; sysdba: REVOKE role1 FROM PUBLIC GRANTED BY user1;
Firebird 3  (plan)‏ Authentication architecture review when using OSRI in firebird Choose (at configuration level) any database as security database, including target database itself Authentication plugins Mapping OS objects to database objects (groups, users, etc.)‏
OSRI (Open System Relational Interface)‏ Engine13 Yvalve Network listener User program (isql, php, etc.)‏ Engine8_12 Network redirector Providers Clients In FB3 we plan to have OSRI alive again. How does it affect auth?
IB, FB1, FB2 – user authentication is in engine Yvalve Network listener Engine “ rear entrance” is used to avoid recursion politically correct  - InterBase 4, 5, 6 TLS – Firebird 1, 2 Authentication Engine needs a way to call itself for authentication purporses without authentication – avoiding infinite recursion
Firebird3 - user authentication in network listener Yvalve Network listener Providers Engine8_12 Engine13 Network redirector Authentication Plugins trusted zone Authenticator and plugins can easily use all our API – in-process access to it. No need in any “rare entrance”.
Firebird 3  (plan)‏ Choose (at configuration level) any database as security database <database alias1> FileName = $(root)/db/data1.fdb Security = $(root)/db/secure.fdb </database> <database inside> FileName = /raid/data.fdb Security = self </database> <database *> FileName = $(arg0)‏ Security = $(root)/security2.fdb </database>
Firebird 3  (plan)‏ Choose any database as security database – another configuration file format, same effect [alias1] FileName = $(root)/db/data1.fdb Security = $(root)/db/secure.fdb [inside] FileName = /raid/data.fdb Security = self [*] FileName = $(arg0)‏ Security = $(root)/security2.fdb
Firebird 3  (plan)‏ Authentication plugins Use any authentication methods Plugin samples Current security database Trusted authentication from 2.1 Trusted authentication based on asymmetric keys match: public – stored on server (in database), private – stored by client Passwords verified in LDAP, PAM, etc. Unlimited length of password Use CHAP to validate passwords
Firebird 3  (plan)‏ Mapping OS objects to database objects Configured on per-database basis using SQL: ALTER ROLE name ADD OS_NAME 'os_name' ALTER USER name ADD OS_NAME 'os_name' ALTER ROLE name DROP OS_NAME 'os_name' ALTER USER name DROP OS_NAME 'os_name' (syntax may be changed)‏
Firebird 3  (plan)‏ Mapping OS objects to database objects OS object may be mapped not more then to single user and single role ALTER USER user1 ADD OS_NAME 'guest' ALTER USER user2 ADD OS_NAME 'guest' Running second command throws an error
Firebird 3  (plan)‏ Mapping OS objects to database objects Security plugin builds a list of OS objects, each of them is assiggned a kind of priority – lower digit means higher priority.  Priority 0 means 'use this object as current_user unconditionally' Providers use information from this list (passed in DPB) to obtain CURRENT_USER and CURRENT_ROLE values.
Firebird 3  (plan)‏ Mapping OS objects to database objects Sample 1 – authentication in security database Security database authentication (when successful) puts single object in a list: Username (1)‏ in () priority is given
Objects list: username (1)‏ < no maps in DB > Firebird 3  (plan)‏ Mapping result: current_user = USERNAME current_role = NONE Example 1 - authentication is security database
Objects list: username (1)‏ ALTER USER SYSDBA ADD OS_NAME 'username' Firebird 3  (plan)‏ Mapping result: current_user = SYSDBA current_role = NONE Example 1 - authentication is security database In this was we have an easy way to grant people “god” rights in particular database.
Firebird 3  (plan)‏ Mapping OS objects to database objects Example 2 – windows trusted authentication Typically this plugin will put in the objects' list something like: Dom\User (1)‏ Domain Users (2)‏ Domain Admins (2)‏
Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ < no maps in DB > Firebird 3  (plan)‏ Mapping result: current_user = Dom\User current_role = NONE Example 2 – windows trusted authentication
Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' Firebird 3  (plan)‏ Mapping result: current_user = Dom\User current_role = RDB$ADMIN Example 2 – windows trusted authentication
Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' Firebird 3  (plan)‏ Mapping result: ERROR – what role to choose? Example 2 – windows trusted authentication
Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' ALTER ROLE USERS ADD OS_NAME 'Dom\User' Use of higher-priority mapping (1) makes it possible to resolve conflict – i.e. users mapping is always prefered over group. Users may be mapped to roles and groups – to users. Firebird 3  (plan)‏ Mapping result: current_user = Dom\User current_role = USERS Example 2 – windows trusted authentication
Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' ALTER ROLE USERS ADD OS_NAME 'Dom\User' ALTER USER GUEST ADD OS_NAME 'Dom\User' This example shows how you should NOT setup mapping in your databases! Firebird 3  (plan)‏ Mapping result: current_user = GUEST current_role = USERS Example 2 – windows trusted authentication
Objects list: Dom\User (1)‏ Finance (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE CHIEF ADD OS_NAME 'Chief' ALTER ROLE FINANCE ADD OS_NAME 'Finance' This is real-life example. Firebird 3  (plan)‏ Mapping result: current_user = Dom\User current_role = FINANCE Example 2 – windows trusted authentication
Thanks for your attention! www.firebirdsql.org

More Related Content

ODP
Firebird 3: provider-based architecture, plugins and OO approach to API
Mind The Firebird
 
PDF
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Ahmed El-Arabawy
 
PDF
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Ahmed El-Arabawy
 
PPT
嵌入式Linux課程-GNU Toolchain
艾鍗科技
 
PDF
Fluentd introduction at ipros
Treasure Data, Inc.
 
PDF
Compilation and Execution
Chong-Kuan Chen
 
PPTX
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
PDF
The Internals of "Hello World" Program
National Cheng Kung University
 
Firebird 3: provider-based architecture, plugins and OO approach to API
Mind The Firebird
 
Embedded Systems: Lecture 11: Introduction to Git & GitHub (Part 2)
Ahmed El-Arabawy
 
Embedded Systems: Lecture 12: Introduction to Git & GitHub (Part 3)
Ahmed El-Arabawy
 
嵌入式Linux課程-GNU Toolchain
艾鍗科技
 
Fluentd introduction at ipros
Treasure Data, Inc.
 
Compilation and Execution
Chong-Kuan Chen
 
The TCP/IP Stack in the Linux Kernel
Divye Kapoor
 
The Internals of "Hello World" Program
National Cheng Kung University
 

What's hot (20)

PPT
101 3.2 process text streams using filters
Acácio Oliveira
 
PPT
101 3.2 process text streams using filters
Acácio Oliveira
 
PPT
3.2 process text streams using filters
Acácio Oliveira
 
PDF
Fluentd meetup dive into fluent plugin (outdated)
N Masahiro
 
PDF
Course 102: Lecture 10: Learning About the Shell
Ahmed El-Arabawy
 
PDF
Program Structure in GNU/Linux (ELF Format)
Varun Mahajan
 
PPT
Unit 7
siddr
 
PPT
Linux Networking Commands
tmavroidis
 
PDF
Java File I/O Performance Analysis - Part I - JCConf 2018
Michael Fong
 
PDF
Uncloaking IP Addresses on IRC
Derek Callaway
 
PDF
Tickling CGI Problems (Tcl Web Server Scripting Vulnerability Research)
Derek Callaway
 
PPTX
06 - ELF format, knowing your friend
Alexandre Moneger
 
PPT
Shell Scripting in Linux
Anu Chaudhry
 
PDF
Dns rebinding
AlaJebnoun
 
PDF
Bytebuf vs DirectByteBuffer
Michael Fong
 
ODP
intro unix/linux 02
duquoi
 
PPT
101 3.5 create, monitor and kill processes
Acácio Oliveira
 
PPT
1.2 boot the system v2
Acácio Oliveira
 
PPT
Linux
Rathan Raj
 
PPTX
Bash shell scripting
VIKAS TIWARI
 
101 3.2 process text streams using filters
Acácio Oliveira
 
101 3.2 process text streams using filters
Acácio Oliveira
 
3.2 process text streams using filters
Acácio Oliveira
 
Fluentd meetup dive into fluent plugin (outdated)
N Masahiro
 
Course 102: Lecture 10: Learning About the Shell
Ahmed El-Arabawy
 
Program Structure in GNU/Linux (ELF Format)
Varun Mahajan
 
Unit 7
siddr
 
Linux Networking Commands
tmavroidis
 
Java File I/O Performance Analysis - Part I - JCConf 2018
Michael Fong
 
Uncloaking IP Addresses on IRC
Derek Callaway
 
Tickling CGI Problems (Tcl Web Server Scripting Vulnerability Research)
Derek Callaway
 
06 - ELF format, knowing your friend
Alexandre Moneger
 
Shell Scripting in Linux
Anu Chaudhry
 
Dns rebinding
AlaJebnoun
 
Bytebuf vs DirectByteBuffer
Michael Fong
 
intro unix/linux 02
duquoi
 
101 3.5 create, monitor and kill processes
Acácio Oliveira
 
1.2 boot the system v2
Acácio Oliveira
 
Linux
Rathan Raj
 
Bash shell scripting
VIKAS TIWARI
 
Ad

Similar to Firebird Security (in English): The Past and The Future (20)

PDF
Introduction to firebidSQL 3.x
Fabio Codebue
 
PDF
Create user to_sysdba
fangjiafu
 
PPTX
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
Michael Noel
 
PDF
Bacula - Backup system
Mohammad Parvin
 
PPTX
DFSNov1.pptx
EngrNabidRayhanKhale
 
PDF
linux installation.pdf
MuhammadShoaibHussai2
 
PPT
DB2UDB_the_Basics
Pranav Prakash
 
PPT
2) security
guptavikki99
 
PPT
Securing Apache Web Servers
Information Technology
 
PPT
Securing Apache Web Servers
webhostingguy
 
PDF
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS
 
PPT
Remote control system (rcs)
Shekh Md Mehedi Hasan
 
DOC
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
PDF
Working with the IFS on System i
Chuck Walker
 
PDF
AMF Testing Made Easy! DeepSec 2012
Luca Carettoni
 
PDF
Security Multitenant
Arush Jain
 
PPT
LDAP Injection & Blind LDAP Injection
Chema Alonso
 
PPT
Windows Server 2008 (Active Directory Yenilikleri)
ÇözümPARK
 
PDF
SQL/MED: Doping for PostgreSQL
Peter Eisentraut
 
PDF
Firebird
Chinsan Huang
 
Introduction to firebidSQL 3.x
Fabio Codebue
 
Create user to_sysdba
fangjiafu
 
TechEd Africa 2011 - OFC308: SharePoint Security in an Insecure World: Unders...
Michael Noel
 
Bacula - Backup system
Mohammad Parvin
 
DFSNov1.pptx
EngrNabidRayhanKhale
 
linux installation.pdf
MuhammadShoaibHussai2
 
DB2UDB_the_Basics
Pranav Prakash
 
2) security
guptavikki99
 
Securing Apache Web Servers
Information Technology
 
Securing Apache Web Servers
webhostingguy
 
Pandora FMS: DB2 Enterprise Plugin
Pandora FMS
 
Remote control system (rcs)
Shekh Md Mehedi Hasan
 
Oracle applications 11i hot backup cloning with rapid clone
Deepti Singh
 
Working with the IFS on System i
Chuck Walker
 
AMF Testing Made Easy! DeepSec 2012
Luca Carettoni
 
Security Multitenant
Arush Jain
 
LDAP Injection & Blind LDAP Injection
Chema Alonso
 
Windows Server 2008 (Active Directory Yenilikleri)
ÇözümPARK
 
SQL/MED: Doping for PostgreSQL
Peter Eisentraut
 
Firebird
Chinsan Huang
 
Ad

More from Alexey Kovyazin (20)

PPTX
High-load performance testing: Firebird 2.5, 3.0, 4.0
Alexey Kovyazin
 
PPTX
Fail-Safe Cluster for FirebirdSQL and something more
Alexey Kovyazin
 
PPTX
Новые возможности языка SQL в Firebird 3.0
Alexey Kovyazin
 
ODP
Firebird recovery tools and techniques by IBSurgeon
Alexey Kovyazin
 
ODP
How Firebird transactions work
Alexey Kovyazin
 
PDF
Life with big Firebird databases
Alexey Kovyazin
 
PDF
Professional tools for Firebird optimization and maintenance from IBSurgeon
Alexey Kovyazin
 
PPTX
Resolving Firebird performance problems
Alexey Kovyazin
 
PDF
Firebird migration: from Firebird 1.5 to Firebird 2.5
Alexey Kovyazin
 
PPTX
Firebird migration: from Firebird 1.5 to Firebird 2.5
Alexey Kovyazin
 
PPTX
Firebird Anti-Corruption Approach
Alexey Kovyazin
 
PPTX
Firebird's Big Databases (in English)
Alexey Kovyazin
 
PDF
Firebird Dataguard (Russian)
Alexey Kovyazin
 
PPT
Решения на базе СУБД Firebird в крупных компаниях и государственных учреждени...
Alexey Kovyazin
 
PDF
Firebird DataGuard - Еще раз об уверенности в завтрашнем дне
Alexey Kovyazin
 
PDF
Firebird usage promo draft
Alexey Kovyazin
 
PPTX
FBScanner: IBSurgeon's tool to solve all types of performance problems with F...
Alexey Kovyazin
 
ODP
Firebird 2.5 - вектор дальнейшего развития, Dmitry Yemanov, (in Russian)
Alexey Kovyazin
 
ODP
Understandung Firebird optimizer, by Dmitry Yemanov (in English)
Alexey Kovyazin
 
PPTX
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)
Alexey Kovyazin
 
High-load performance testing: Firebird 2.5, 3.0, 4.0
Alexey Kovyazin
 
Fail-Safe Cluster for FirebirdSQL and something more
Alexey Kovyazin
 
Новые возможности языка SQL в Firebird 3.0
Alexey Kovyazin
 
Firebird recovery tools and techniques by IBSurgeon
Alexey Kovyazin
 
How Firebird transactions work
Alexey Kovyazin
 
Life with big Firebird databases
Alexey Kovyazin
 
Professional tools for Firebird optimization and maintenance from IBSurgeon
Alexey Kovyazin
 
Resolving Firebird performance problems
Alexey Kovyazin
 
Firebird migration: from Firebird 1.5 to Firebird 2.5
Alexey Kovyazin
 
Firebird migration: from Firebird 1.5 to Firebird 2.5
Alexey Kovyazin
 
Firebird Anti-Corruption Approach
Alexey Kovyazin
 
Firebird's Big Databases (in English)
Alexey Kovyazin
 
Firebird Dataguard (Russian)
Alexey Kovyazin
 
Решения на базе СУБД Firebird в крупных компаниях и государственных учреждени...
Alexey Kovyazin
 
Firebird DataGuard - Еще раз об уверенности в завтрашнем дне
Alexey Kovyazin
 
Firebird usage promo draft
Alexey Kovyazin
 
FBScanner: IBSurgeon's tool to solve all types of performance problems with F...
Alexey Kovyazin
 
Firebird 2.5 - вектор дальнейшего развития, Dmitry Yemanov, (in Russian)
Alexey Kovyazin
 
Understandung Firebird optimizer, by Dmitry Yemanov (in English)
Alexey Kovyazin
 
Firebird: cost-based optimization and statistics, by Dmitry Yemanov (in English)
Alexey Kovyazin
 

Recently uploaded (20)

PDF
The Future of Artificial Intelligence (AI)
Mukul
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
PDF
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PPTX
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
The Future of Artificial Intelligence (AI)
Mukul
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
Doc9.....................................
SofiaCollazos
 
Software Development Methodologies in 2025
KodekX
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
AI in Daily Life: How Artificial Intelligence Helps Us Every Day
vanshrpatil7
 
How ETL Control Logic Keeps Your Pipelines Safe and Reliable.pdf
Stryv Solutions Pvt. Ltd.
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Introduction to Flutter by Ayush Desai.pptx
ayushdesai204
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 

Firebird Security (in English): The Past and The Future

  • 1. Security in Firebird: 2.1, 2.5, 3.0 Alex Peshkov (peshkoff at mail.ru)
  • 2. First years of InterBase In order to understand security problems of Firebird, we should consider historical issues At that time there was another approach to database and server security
  • 3. First years of InterBase 1984 – hardware and software was not like today No Internet like we see it today Hardware (PDP11, VAX11) requirements to run RDBMS Multiuser mode is 'many processes', not 'many threads' – relatively safe even in case of buffer overflow
  • 4. First years of InterBase No strong requirements to RDBMS security No abilities to support strong requirements even if they presented -- as the result -- Lot of small buffers without overflow control External tables and UDFs – one can store any data as external table and call as UDF 'root' runuser RDBMS is anyway safe!
  • 5. Approach to security in Borland 1992-1993: Windows 3.X port Need to have own users list – database isc4.gdb Access to it from server itself for authentication purposes (use of login 'politically' and password 'correct' for it)‏ Local access protocol using Windows events (PostEvent(), etc.)‏
  • 6. Windows NT (95) port Use of multi-thread access model instead of mutli-process No buffers' size review (!) No integration between own users list and host OS accounts Local protocol is still using Windows Events Runs as LocalSystem account Borland security solutions for InterBase
  • 7. Firebird security development Year 2002: 1.0 Fixed serious vulnerability was eliminated “ politically correct” left the building Assessment of the most dangerous places in firebird code base
  • 8. Firebird security development Year 2004: 1.5 Fixed vulnerabilities: 'root' (LocalSystem) server execution (in Windows – prevents use of local access protocol)‏ Arbitrary code execution using standard SQL language tools (External Table + UDF)‏ Access to any database as a 'raw' file Some buffers overflows
  • 9. Firebird security development Year 2006: 2.0 Fixed vulnerabilities: More buffers overflows fixed Ability to read passwords' hashes from security database using any valid login Started code review in order to completely avoid buffer overflows in strings (file names, etc.)‏ New feature: User can change own password (only superuser could change any password before)‏
  • 10. Firebird 2.1- what's new Fixed vulnerability: Finished buffers overflow hunting – no new bugreports during last year. New feature: Use Windows trusted authentication to login to Firebird server
  • 11. Firebird 2.1: windows trusted authentication Authentication using own security database Client Server Attach Accept (or reject)‏
  • 12. Firebird 2.1: windows trusted authentication Using windows trusted authentication Client Server ...... May require passing data between client and server many times. Use native authentication API Attach trusted Request to adjust security contex Adjusted security context Accept (or reject)‏
  • 13. Traditional authentication (client)‏ fbclient library isc_dpb_user_name isc_dpb_password ......... Environment variables isc_dpb_user_name isc_dpb_password ......... Login/password may be picked up from environment by client library ISC_USER=..
  • 14. Traditional authentication (server)‏ Network listener Database engine Validation in security database isc_dpb_user_name isc_dpb_password ......... isc_dpb_user_name isc_dpb_password Validation is performed by DB engine
  • 15. Trusted authentication (client)‏ isc_dpb_trusted ......... ......... ......... Environment variables fbclient library Client library automatically adds trusted auth request to DPB
  • 16. Trusted Authentication (client)‏ ......... ......... isc_dpb_user_name isc_dpb_password ......... Environment variables fbclient library Login is picked up from environmnet (backward compatibility)‏ ISC_USER=..
  • 17. Trusted Authentication (client)‏ isc_dpb_trusted isc_dpb_trusted ......... ......... Environment variables fbclient library Adding isc_dpb_trusted by application to force trusted auth. ISC_USER=..
  • 18. Trusted Authentication (server)‏ isc_dpb_trusted Network listener .......... isc_dpb_trusted ......... DB engine Host OS validation (callback)‏ Network listener does all work, on success puts internal tag into DPB.
  • 19. Trusted Authentication (server)‏ isc_dpb_trusted Network listener .......... isc_dpb_trusted ......... isc_dpb_trusted Host OS validation (callback)‏ DB engine Safe - network listener removes extra isc_dpb_trusted tags from DPB
  • 20. Firebird 2.5 - what's new Fixed vulnerabilities Attack on server using large packets with garbage New features User management in SQL (CREATE / ALTER / DROP USER)‏ System role RDB$ADMIN Configure mapping of domain administrators to RDB$ADMIN role using SQL New GRANTED BY clause in GRANT and REVOKE operators
  • 21. Firebird 2.5 - what's new User management in SQL CREATE USER name PASSWORD 'pw' FIRSTNAME 'first' MIDDLENAME 'middle' LASTNAME 'last' ALTER USER name PASSWORD 'pw' FIRSTNAME 'first' MIDDLENAME 'middle' LASTNAME 'last' DROP USER name
  • 22. Firebird 2.5 - what's new User management in SQL In firebird 2.5 this commands always work with common security database security2.fdb Alter User <Current_user> is available for all users, the rest – only to SYSDBA
  • 23. Firebird 2.5 - what's new System role RDB$ADMIN GRANT “RDB$ADMIN” TO GUEST1 When attaching to current database with role RDB$ADMIN user GUEST1 will have all rights of database administrator (SYSDBA)‏ REVOKE “RDB$ADMIN” FROM GUEST1
  • 24. Firebird 2.5 - what's new Configure mapping of domain administrators to RDB$ADMIN role using SQL ALTER ROLE RDB$ADMIN SET / DROP AUTO ADMIN MAPPING This is restricted form of a command, planned to control mapping of host OS objects to database objects in firebird 3
  • 25. Firebird 2.5 - what's new New GRANTED BY clause in GRANT and REVOKE operators Makes it possible for SYSDBA to revoke rights, granted by other users
  • 26. Firebird 2.5 - what's new sysdba: CREATE ROLE role1; GRANT role1 TO user1 WITH ADMIN OPTION; user1: GRANT role1 TO PUBLIC; sysdba: REVOKE role1 FROM PUBLIC GRANTED BY user1;
  • 27. Firebird 3 (plan)‏ Authentication architecture review when using OSRI in firebird Choose (at configuration level) any database as security database, including target database itself Authentication plugins Mapping OS objects to database objects (groups, users, etc.)‏
  • 28. OSRI (Open System Relational Interface)‏ Engine13 Yvalve Network listener User program (isql, php, etc.)‏ Engine8_12 Network redirector Providers Clients In FB3 we plan to have OSRI alive again. How does it affect auth?
  • 29. IB, FB1, FB2 – user authentication is in engine Yvalve Network listener Engine “ rear entrance” is used to avoid recursion politically correct - InterBase 4, 5, 6 TLS – Firebird 1, 2 Authentication Engine needs a way to call itself for authentication purporses without authentication – avoiding infinite recursion
  • 30. Firebird3 - user authentication in network listener Yvalve Network listener Providers Engine8_12 Engine13 Network redirector Authentication Plugins trusted zone Authenticator and plugins can easily use all our API – in-process access to it. No need in any “rare entrance”.
  • 31. Firebird 3 (plan)‏ Choose (at configuration level) any database as security database <database alias1> FileName = $(root)/db/data1.fdb Security = $(root)/db/secure.fdb </database> <database inside> FileName = /raid/data.fdb Security = self </database> <database *> FileName = $(arg0)‏ Security = $(root)/security2.fdb </database>
  • 32. Firebird 3 (plan)‏ Choose any database as security database – another configuration file format, same effect [alias1] FileName = $(root)/db/data1.fdb Security = $(root)/db/secure.fdb [inside] FileName = /raid/data.fdb Security = self [*] FileName = $(arg0)‏ Security = $(root)/security2.fdb
  • 33. Firebird 3 (plan)‏ Authentication plugins Use any authentication methods Plugin samples Current security database Trusted authentication from 2.1 Trusted authentication based on asymmetric keys match: public – stored on server (in database), private – stored by client Passwords verified in LDAP, PAM, etc. Unlimited length of password Use CHAP to validate passwords
  • 34. Firebird 3 (plan)‏ Mapping OS objects to database objects Configured on per-database basis using SQL: ALTER ROLE name ADD OS_NAME 'os_name' ALTER USER name ADD OS_NAME 'os_name' ALTER ROLE name DROP OS_NAME 'os_name' ALTER USER name DROP OS_NAME 'os_name' (syntax may be changed)‏
  • 35. Firebird 3 (plan)‏ Mapping OS objects to database objects OS object may be mapped not more then to single user and single role ALTER USER user1 ADD OS_NAME 'guest' ALTER USER user2 ADD OS_NAME 'guest' Running second command throws an error
  • 36. Firebird 3 (plan)‏ Mapping OS objects to database objects Security plugin builds a list of OS objects, each of them is assiggned a kind of priority – lower digit means higher priority. Priority 0 means 'use this object as current_user unconditionally' Providers use information from this list (passed in DPB) to obtain CURRENT_USER and CURRENT_ROLE values.
  • 37. Firebird 3 (plan)‏ Mapping OS objects to database objects Sample 1 – authentication in security database Security database authentication (when successful) puts single object in a list: Username (1)‏ in () priority is given
  • 38. Objects list: username (1)‏ < no maps in DB > Firebird 3 (plan)‏ Mapping result: current_user = USERNAME current_role = NONE Example 1 - authentication is security database
  • 39. Objects list: username (1)‏ ALTER USER SYSDBA ADD OS_NAME 'username' Firebird 3 (plan)‏ Mapping result: current_user = SYSDBA current_role = NONE Example 1 - authentication is security database In this was we have an easy way to grant people “god” rights in particular database.
  • 40. Firebird 3 (plan)‏ Mapping OS objects to database objects Example 2 – windows trusted authentication Typically this plugin will put in the objects' list something like: Dom\User (1)‏ Domain Users (2)‏ Domain Admins (2)‏
  • 41. Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ < no maps in DB > Firebird 3 (plan)‏ Mapping result: current_user = Dom\User current_role = NONE Example 2 – windows trusted authentication
  • 42. Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' Firebird 3 (plan)‏ Mapping result: current_user = Dom\User current_role = RDB$ADMIN Example 2 – windows trusted authentication
  • 43. Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' Firebird 3 (plan)‏ Mapping result: ERROR – what role to choose? Example 2 – windows trusted authentication
  • 44. Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' ALTER ROLE USERS ADD OS_NAME 'Dom\User' Use of higher-priority mapping (1) makes it possible to resolve conflict – i.e. users mapping is always prefered over group. Users may be mapped to roles and groups – to users. Firebird 3 (plan)‏ Mapping result: current_user = Dom\User current_role = USERS Example 2 – windows trusted authentication
  • 45. Objects list: Dom\User (1)‏ Domain Admins (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE USERS ADD OS_NAME 'Domain Users' ALTER ROLE USERS ADD OS_NAME 'Dom\User' ALTER USER GUEST ADD OS_NAME 'Dom\User' This example shows how you should NOT setup mapping in your databases! Firebird 3 (plan)‏ Mapping result: current_user = GUEST current_role = USERS Example 2 – windows trusted authentication
  • 46. Objects list: Dom\User (1)‏ Finance (2)‏ Domain Users (2)‏ ALTER ROLE “RDB$ADMIN” ADD OS_NAME 'Domain Admins' ALTER ROLE CHIEF ADD OS_NAME 'Chief' ALTER ROLE FINANCE ADD OS_NAME 'Finance' This is real-life example. Firebird 3 (plan)‏ Mapping result: current_user = Dom\User current_role = FINANCE Example 2 – windows trusted authentication
  • 47. Thanks for your attention! www.firebirdsql.org