On this page:
8.1 What is This Assignment’s Purpose?
8.2 Assignment
8.2.1 Gradescope
8.2.2 Hotel Keys
8.2.3 A Card on File
8.3 What To Hand In

CSCI 1730 · Fall 2026

8 POLA🔗

    8.1 What is This Assignment’s Purpose?

    8.2 Assignment

      8.2.1 Gradescope

      8.2.2 Hotel Keys

      8.2.3 A Card on File

    8.3 What To Hand In

8.1 What is This Assignment’s Purpose?🔗

OCaps was about machinery to attenuate authority. This one is about deciding what the right amount of authority is, according to the Principle of Least Authority (POLA). If you want a quick refresher on POLA, see this article by Kate Sills (then at Agoric), which illustrates it using the Event-Stream attack and describes some real-world Object Capability (OCaps) systems.

However, OCaps are only as useful as the authorities that are handed out. If, for instance, every function is accidentally given full authority, then OCaps offers no extra protection over conventional ambient authority. Therefore, to be effective, we have to reason about what entity needs what authority, what granting of authority needs to be attenuated, when it must be limited to a certain number of uses or revoked (so that we really are ensuring the least authority), etc.

This assignment is therefore analogous to IFC Design. There we designed information-flow labels; here we will design least authorities.

8.2 Assignment🔗

You are given the following three situations. In each case, you will do the following.

Each situation names its parties and then lists events: things that happen in that world. In the system as a whole, one party owns all the resources, and all authority originates from it; we call that party the platform. Every other party holds only what the platform handed it, directly or through another party.

Read each event and decompose it into a set of operations. Each operation is performed by some party. (An event can require multiple operations, e.g., by different parties.) For each operation, state the least authority it needs, including any attenuations: a part of a resource rather than the whole, a read-only view, a copy of a value rather than a reference, a bound on uses or amount, an expiry, a revocation, etc. An authority is a right to do something with a resource, not the resource itself. In some cases, an operation may need no authority at all.

Present the result as a table with one row per operation and five columns: the number of the event the operation comes from, the party that performs it, the operation, the least authority it needs (with its attenuations, since those are what make it least), and the party that grants that authority (which must hold it in the first place). Each situation below ends with a few rows to show the form; continue from there. The events are numbered so that you can refer to them.

Some events are ones we don’t want to have succeed. For such events, don’t add a table row. Instead, write an explanation of what authorities it would need to succeed, which party or parties would have to hold them, and then check your able. Either no row grants it, so the attempt fails; or some row has to grant it, in which case say what that row’s attenuations limit the damage to.

8.2.1 Gradescope🔗

Gradescope documents its autograder at Autograder Specifications. The instructor uploads material (tests, expected outputs, grading code), which Gradescope unpacks into one directory inside a container. The student’s submission goes into a second directory. The grading script, run_autograder, runs once per submission and writes its verdict to a file, results.json, in a third directory, which Gradescope reads to produce the grade. Gradescope uses timeouts to stop excessively-long runs. A second page, Best Practices, catalogs what has gone wrong for instructors. Skim it for a sense of scale: Gradescope guards against none of it by default.

Needless to say, we expect you not to use any of this to exploit an autograder, ours or anyone else’s.

In the autograders we consider, the instructor’s tests call functions in the student’s code and report which tests passed. As Gradescope sets things up, there is just one party. In an ideal system, however, we would like several parties with varying authorities: Gradescope, the platform, which starts the script; the instructor’s script, which includes the tests; the student’s code; and the network, which stands for everyone else. Assume that any packages the script needs are installed when Gradescope builds the container image, before any submission exists.

The events:

  1. A student submits. Gradescope starts a fresh container with the material and the submission, and runs the script.

  2. The script reads the submission and loads the student’s code.

  3. The tests call the student’s functions with arguments and check what comes back.

  4. A student’s solution still has debugging prints in it, and it writes an intermediate file to disk that it reads back later.

  5. The student’s code opens a network connection.

  6. The student’s code loops forever, allocates until memory runs out, or prints without end. Eventually Gradescope kills the container at its timeout.

  7. A student’s code tries to read the tests, and tries to write a perfect score into the results file, whose location the Autograder Specifications document.

  8. The script writes the results: scores, per-test output, and which of it the student may see. Gradescope reads them and shows the student the visible parts.

To get you started:

Event

   

Party

   

Operation

   

Least authority (with attenuations)

   

Granted by

2

   

the script

   

read the submission

   

read access to the submission directory

   

Gradescope

6

   

Gradescope

   

stop a run

   

the right to kill the container

   

—

8.2.2 Hotel Keys🔗

A hotel issues key cards. The front desk writes them on a machine called an encoder, and each lock reads a card and decides on its own whether to open. In most hotels the locks are not networked:Hotel door locks are fascinating! To understand how they work, see this FlyerTalk explanation, this Straight Dope thread, or, for the full technical detail of one vendor’s locks, Brocious’s Black Hat paper. a card is an authority in itself. A lock accepts a card for its room until a newer card for that room is presented to it, after which the older one stops working.

The parties: the hotel, which owns every lock and the encoder, and is the platform; the front-desk clerk; the guest; a friend of the guest; housekeeping; a plumber; and the manager.

The events:

  1. A guest checks in for three nights. During the stay they need to reach and enter their room, and they want to use the gym.

  2. Someone comes to the front desk, says they are the guest in room 412 and have lost their card, and asks for a replacement.

  3. The guest wants a friend to be able to get into the room this evening while the guest is out.

  4. The housekeeper assigned to a floor cleans each of its rooms during a shift, except one whose guest has hung a do-not-disturb sign.

  5. A plumber is sent to fix the shower in room 412 under a work order.

  6. The guest, in the room, has forgotten the code to the room safe and calls the front desk. The manager comes up, and the guest lets them in to open it.

  7. Someone finds a card in the lobby and tries it on doors.

To get you started:

Event

   

Party

   

Operation

   

Least authority (with attenuations)

   

Granted by

1

   

the clerk

   

issue a guest card

   

permission to issue a card for that room, expiring at checkout

   

the hotel

1

   

the guest

   

enter the room

   

a card that opens that room only, until checkout

   

the clerk

8.2.3 A Card on File🔗

You shop at an online clothing store and pay by credit card. When you pay, the store asks the card network to authorize the amount, the bank approves it against your account’s limit, and the money moves from your account to the store’s. The store offers to save your card so that you need not enter it again. As a simplifying assumption, treat the details printed on the card (its number, expiry date, and security code) as all it takes: anyone who has them can charge the account this way, from anywhere, until the card expires or the bank cancels it.

The parties: your bank and the card network, which own the account and the rails that payments move over, and together are the platform; you, the account holder; the store; and a thief.

The events:

  1. You buy a jacket and, at checkout, tick the box to save your card for next time.

  2. A month later you buy a pair of socks with one click.

  3. You return the jacket, and the store refunds you.

  4. You sign up for the store’s monthly surprise box, which charges you every month until you cancel.

  5. Someone who has guessed your store password orders clothes shipped to themselves.

  6. The store’s database leaks, and charges from merchants you have never heard of appear.

  7. Your card expires, and the bank sends you a new one.

  8. You close your account with the store, and it must not be able to charge you afterward.

To get you started:

Event

   

Party

   

Operation

   

Least authority (with attenuations)

   

Granted by

1

   

the bank

   

authorize the charge

   

the right to debit your account, up to its limit

   

—

1

   

the store

   

collect the price of the jacket

   

an authorization for that amount

   

the bank

8.3 What To Hand In🔗

Assemble a single document with one section per situation. Each section contains that situation’s table, with one row per operation, unless an event is undesirable; if so, say what (if anything) prevents it or bounds its damage. Where a row’s least authority or attenuation is not obvious, say why (in prose after the table).