The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

25 years ago, around this period, the InterBase 6 / Firebird 1 prerelease gaping security hole was detected: a user politically with password correct would gain database access

Posted by jpluimers on 2025/12/24

Before Firebird version 1.0 got released, a gaping security hole that InterBase introduced in 1994 before InterBase 6.0 (mostly written in C) got open sourced in 2000 was detected by the team that frantically tried the Firebird fork to first get building on various platforms, then released.

It had a maximum CVSS score of 10.0 because it could access the security database in read/write mode, thereby allowing adding users with SYSDBA privileges.

The detection is now about 25 years ago; on 20260109 the publication (by IBPhoenix) of the bug will be 25 years ago too.

So below are some links, including the original InterBase 6 source which was hard to find as the attachments of the original release links had not been archived in the Wayback Machine.

But first some of the code parts, which also shows the source file I did find back:

Files relative to recursively unpacked [Waybackwww.ic.unicamp.br/~celio/mc527/interbase/ib60src.tar.gz 
File Line# Code
./ib60src/InterBase/jrd/dyn.e
266
    if ((tdbb->tdbb_attachment->att_user->usr_flags & USR_locksmith) ||
./ib60src/InterBase/jrd/dyn.e
311
    **  only owner of SQL role or USR_locksmith could drop SQL role
./ib60src/InterBase/jrd/dyn.e
1610
/* If the current user is locksmith - allow all grants to occur */
./ib60src/InterBase/jrd/dyn.e
1612
if (tdbb->tdbb_attachment->att_user->usr_flags & USR_locksmith)
./ib60src/InterBase/jrd/dyn.e
1820
if (tdbb->tdbb_attachment->att_user->usr_flags & USR_locksmith)
./ib60src/InterBase/jrd/dyn.e
2062
         if ((revoking_user->usr_flags & USR_locksmith) ||
./ib60src/InterBase/jrd/dyn.e
2092
         if ((revoking_user->usr_flags & USR_locksmith) ||
./ib60src/InterBase/jrd/isc.c
240
extern uid_$t   acl_$locksmith_uid;
./ib60src/InterBase/jrd/isc.c
1277
     return (!strcmp (name, "USER") && !strcmp (project, "LOCKSMITH"));
./ib60src/InterBase/jrd/isc.c
1315
    return (sid.proj.high == acl_$locksmith_uid.high &&
./ib60src/InterBase/jrd/isc.c
1316
         sid.proj.low  == acl_$locksmith_uid.low);
./ib60src/InterBase/jrd/jrd.c
901
    !(attachment->att_user->usr_flags & (USR_locksmith | USR_owner)))
./ib60src/InterBase/jrd/jrd.c
991
    !(attachment->att_user->usr_flags & (USR_locksmith | USR_owner)))
./ib60src/InterBase/jrd/jrd.c
2115
if (!attachment->att_user->usr_flags & (USR_locksmith | USR_owner))
./ib60src/InterBase/jrd/jrd.c
4299
    !(attachment->att_user->usr_flags & (USR_locksmith | USR_owner))))
./ib60src/InterBase/jrd/pwd.c
323
TEXT    locksmith_password_enc [33];
./ib60src/InterBase/jrd/pwd.c
328
/* Encrypt and copy locksmith's password under the global scheduler's
./ib60src/InterBase/jrd/pwd.c
332
strcpy (locksmith_password_enc, ENC_crypt (LOCKSMITH_PASSWORD, PASSWORD_SALT));
./ib60src/InterBase/jrd/pwd.c
352
*dpb++ = strlen (LOCKSMITH_USER);
./ib60src/InterBase/jrd/pwd.c
353
p = LOCKSMITH_USER;
./ib60src/InterBase/jrd/pwd.c
358
p = locksmith_password_enc + 2;
./ib60src/InterBase/jrd/pwd.h
30
#define LOCKSMITH_USER  "politically"
./ib60src/InterBase/jrd/pwd.h
31
#define LOCKSMITH_PASSWORD "correct"
./ib60src/InterBase/jrd/scl.e
531
TEXT  locksmith_password[20];
./ib60src/InterBase/jrd/scl.e
532
TEXT  locksmith_password_enc[33];
./ib60src/InterBase/jrd/scl.e
533
TEXT  user_locksmith[20];
./ib60src/InterBase/jrd/scl.e
561
    strcpy (locksmith_password, LOCKSMITH_PASSWORD);
./ib60src/InterBase/jrd/scl.e
562
    strcpy (user_locksmith, LOCKSMITH_USER);
./ib60src/InterBase/jrd/scl.e
563
    strcpy (locksmith_password_enc, ENC_crypt (locksmith_password, PASSWORD_SALT));
./ib60src/InterBase/jrd/scl.e
564
    if (strcmp (user_name, user_locksmith) || (password_enc == NULL) ||
./ib60src/InterBase/jrd/scl.e
565
      strcmp (password_enc, locksmith_password_enc + 2))
./ib60src/InterBase/jrd/scl.e
636
    user->usr_flags |= USR_locksmith;
./ib60src/InterBase/jrd/scl.e
1128
if (user.usr_flags & USR_locksmith)
./ib60src/InterBase/jrd/scl.h
81
#define USR_locksmith  1               /* User has great karma */
./ib60src/InterBase/jrd/scl.h
86
 * User name assigned to any user granted USR_locksmith rights.
./ib60src/InterBase/jrd/shut.c
131
/* Only platform's user locksmith can shutdown or bring online
./ib60src/InterBase/jrd/shut.c
134
if (!attachment->att_user->usr_flags & (USR_locksmith | USR_owner))
./ib60src/InterBase/jrd/tra.c
3103
strcpy (password_enc, (char *)ENC_crypt (LOCKSMITH_PASSWORD, PASSWORD_SALT));
./ib60src/InterBase/jrd/tra.c
3111
*dpb++ = strlen (LOCKSMITH_USER);
./ib60src/InterBase/jrd/tra.c
3112
q = LOCKSMITH_USER;
./ib60src/InterBase/utilities/dba_full.e
618
*dpb++ = strlen (LOCKSMITH_USER);
./ib60src/InterBase/utilities/dba_full.e
619
q = LOCKSMITH_USER;
./ib60src/InterBase/utilities/dba_full.e
624
strcpy (password_enc, (char *)ENC_crypt (LOCKSMITH_PASSWORD, PASSWORD_SALT));

For your enjoyment, the list of links:

Via

Queries:

--jeroen

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.