CTSS: Security
Did the concept of computer security exist before CTSS? In the world of batch processing, access to computer resources was done by submitting a deck of punched cards or a magnetic tape to the computer operations staff who would supervise its execution, so only physical access control was needed. There was also no concept of persistent, private data residing in the system - any such data would be physical, on paper or tape, to be held by the user or computer centre offline.
CTSS introduced the idea of multiple users accessing the system at the same time, so now there was the problem of how to prevent one program interfering with another. Access to the system was from outside the computer room, via typewriters wired to the computer or even remotely via modem, so there needed to be some way to control this. Finally, CTSS had a hard disk where files could be stored and control was needed over who could access them.
File access was covered in CTSS Files & Directories; in this post we will look at resource protection and login control.
Resource protection
In a multi-user system a programmer should no longer have direct access to all hardware resources; access needs to be mediated through the operating system.
As several programs can be loaded in core memory at any time, CTSS prevents direct access to memory that is not part of your program. For example, take this assembly language program.
CLA 0
TSX CHNCOM,4
CHNCOM TIA =HCHNCOM
END
The important line here is the first one: CLA addr
will clear the
accumulator and load it with the contents of memory at address addr
.
The remaining two lines will cause the program to exit by calling the
CHNCOM
system routine.
Compiling and executing this program works fine. But if I change the address to 7000 it will give a protection error.
p test fap W 954.3 CLA 7000 TSX CHNCOM,4 CHNCOM TIA =HCHNCOM END R .016+.016 fap test W 954.3 LENGTH 4 R .016+.000 loadgo test W 954.4 EXECUTION. PROTECTION MODE VIOLATION AT 05360. INS.=050000015530, RI.=000000000000, PI.=005364000000 R .000+.016
Internally this is handled by the supervisor setting two protection registers representing the upper and lower bounds of memory areas the program can reach, along with a relocation register to map logical to physical address.
There is also protection against trying to change these registers, or trying to access I/O devices directly.
Login control
Early versions of CTSS had a login
command to identify which user
wanted to start a session: the user would provide their problem and
programmer number but no password was required. The CTSS Programmer's
Guide from 1963 states:
In the future an additional parameter may be required in order to afford greater security for the user. This will probably be in the form of a private code given separately; explicit instructions will be given by the
login
command if necessary.
Passwords were probably added around May 1964 according to Time
Sharing System Notes #4. When the user entered the login
command,
the computer would prompt for the password and turn off the
typewriter's print head so the user could enter it without it being
displayed. If it matched, the user was logged in.
Note the login
command prints different error messages depending on
whether the user name or password was incorrect, which does mean it is
possible to determine whether a user name is valid.
login nouser W 1025.2 Password NOUSER NOT FOUND IN DIRECTORY LOGIN COMMAND INCORRECT READY. login guest W 1025.4 Password PASSWORD NOT FOUND IN DIRECTORY LOGIN COMMAND INCORRECT READY.
User information is stored in the file UACCNT TIMACC
in common files
#2. Passwords are stored in plain text. It is possible to view the
file using the emulated system; in the real system this likely would
have had file protection set so non-system users could not open it.
Here we can see that user guest
's password is system
.
comfil 2 W 1050.9 R .000+.000 p UACCNT TIMACC W 1050.9 ... GUEST 5000001000000GUEST 000001000001000000SYSTEM 000000004000000000000360000360000360000360000360 ...
Further control was provided by specifying a group of lines the user could login from, and giving each user a quota of time to access the system, divided into shifts (for example, shift 1 was Monday to Friday, 8am to 6pm).
Contents of these files were set by operations staff; it is not possible for the user to change their password online.
The structure of the user accounting files is described in the 1969 Programmer's Guide section AD.5.
Access control hacks
The IEEE put together The CTSS Fiftieth Anniversary Commemorative Overview which contains many interesting stories about CTSS. There is one entry by Allan Scherr who was about to lose access to system files and CPU quota, but wanted to find a way to keep running his program.
Late one Friday night, I submitted a request to print the password files and very early Saturday morning went to the file cabinet where printouts were placed and took the listing out of the M1416 folder. I could then continue my larceny of machine time.
As the passwords were in plain text, the printout of the file was all that was needed to get access to other accounts.
Denial of service
Another story in the IEEE overview recounted by Tom Van Vleck recounts
how Bill Mathews noticed an error where the password file had been
mixed up with the message of the day file so all users could see
passwords for other users when they logged in. Bill wanted to limit
the damage by crashing the machine: the way he did this was to enter
the debugger and issue the assembly instruction XEC *
. XEC
means
read the word at the given address and execute it; *
means the
current address, so this is effectively an infinite loop.
We can recreate this on the emulated system (using FAP):
edc splat fap W 1836.2 FILE SPLAT FAP NOT FOUND. Input: XEC * END Edit: file R .016+.016 fap splat W 1836.4 LENGTH 1 R .016+.033 load splat W 1836.9 R .000+.016 start W 1836.9 EXECUTION.
Now the program (and all other user sessions) do not respond to further input and even the s709 emulator needs to be force killed to recover from this.
Questions, corrections, comments
I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com