Serverless Over-Privilege

Serverless Over-Privilege

A function is a principal, and its credentials are ambient.

What Is Serverless Over-Privilege?

A function is a principal. Its execution role credentials are ambient, so anyone who can make the function run holds the role without stealing anything. That is fine until an image resizer holds account-wide permissions, keeps secrets in environment variables, and takes unauthenticated requests. You'll spot the function URL in the browser network panel, trip a leftover debug flag that dumps the environment, and read a production secret as the function. Then you'll scope the role, require IAM auth, and move secrets to a manager reference.

What You'll Learn in Serverless Over-Privilege

Serverless Over-Privilege — Training Steps

  1. Start where everyone can look

    Bob is not inside Vaelrick. He is on their public property-listings site, the same page any buyer sees. There is nothing privileged here - which is exactly why it is where he starts.

  2. Watch what the page asks for

    Bob opens the browser's network panel and reloads the page, so he can see the requests the gallery makes before any image appears.

  3. It answers anyone

    Bob calls the endpoint directly from his own machine, with no credentials at all.

  4. The debug flag dumps its identity

    Bob adds the debug parameter the site told him about. The function prints its whole environment.

  5. Put on the function's identity

    The three AWS_ values from the dump are a complete, working set of temporary credentials. Bob loads them into a named profile on his own machine, and from that moment his CLI can act as the function.

  6. Become the function

    The profile is loaded. Bob asks AWS the first question any attacker asks with a fresh set of credentials: who am I now?

  7. How far does a thumbnail maker reach?

    A function that writes thumbnails should see one bucket. Bob asks for all of them.

  8. Take the crown jewels

    Bob uses the role to read a secret that has nothing whatsoever to do with resizing images.

  9. Which failure did the damage?

    Before the response, name what turned a leaked endpoint into a production breach.

  10. Someone is using our Stripe key

    Vaelrick's payment processor flagged API calls signed with their live key from an unfamiliar address. That key lives in Secrets Manager, which is supposed to be the safe place for it.

Security Framework Coverage

CWE

  • CWE-250 Execution with Unnecessary Privileges
  • CWE-522 Insufficiently Protected Credentials

MITRE ATT&CK

  • T1552 Unsecured Credentials
  • T1078.004 Valid Accounts: Cloud Accounts

CIS Controls

  • CIS 6 Access Control Management

NIST CSF

  • PR.AT-02 Individuals in specialized roles are provided with awareness and training so that they possess the knowledge and skills to perform relevant tasks with cybersecurity risks in mind
  • PR.AA Identity Management, Authentication, and Access Control