Skip to content
Report library
Purpose / Data analysis

Extension Authorization Skill Security Audit

What the author says it does (original text)

Authorization system with role-based access control. Must-have for all apps that manage personal or access-restricted data.

Independent security check

Do not install or run it yet

Files checked
2
Risks found
2
Could it run dangerous commands?Looks for programs run straight after downloading, remote control of your computer, and hidden commands.No risks found
Could it expose your files or keys?Looks for uploads of files containing passwords or keys, and keys written directly in the code.Risks found: 1
Medium risk

Enabling the attribute callback stores identity email in application state at sign-in

Source references: 5
What we found

The Skill recommends receiving identity-provider attributes in a sign-in callback and demonstrates writing email into persistent application state by principal. Collection occurs through the sign-in callback rather than only when a user actively submits profile data.

Why this matters

The application then holds personally identifying email data; later backups, administrative interfaces, state exports, or application vulnerabilities could broaden its exposure.

This risk applies when the app supplies a non-null callback to `MixinAuthorization`: verified name, email, and SSO attributes are then delivered to the app once per sign-in. The example stores email by principal in an application `emails` map and exposes a caller-only getter. Users can ask the author to document retention, deletion, and purpose, or require the second argument to remain `null` and collect only necessary attributes. The shown source does not send email to an external service.

SKILL.md:178In the instructionsOpen original file
`MixinAuthorization` can capture the user's verified Internet Identity attributes (name and email) at sign-in. Pass a callback as the second argument instead of `null`; it runs once per sign-in, after the attribute bundle has been verified.
Show 4 other places
SKILL.md:199In the instructionsOpen original file
Store them in your own state and expose a getter to read them back:
SKILL.md:211In the instructionsOpen original file
  let emails : Map.Map<Principal, Text>;  include MixinAuthorization(    accessControlState,    ?(func(caller : Principal, attrs : { name : ?Text; email : ?Text; sso : ?Text }) {      switch (attrs.email) {        case (?email) { emails.add(caller, email) };        case null {};      };    }),
SKILL.md:213In the instructionsOpen original file
  include MixinAuthorization(    accessControlState,    ?(func(caller : Principal, attrs : { name : ?Text; email : ?Text; sso : ?Text }) {      switch (attrs.email) {        case (?email) { emails.add(caller, email) };        case null {};      };    }),  );
SKILL.md:223In the instructionsOpen original file
  public query ({ caller }) func getCallerEmail() : async ?Text {    emails.get(caller);  };};
Could it delete files or keep running?Looks for broad file deletion, disk overwrites, and programs set to start automatically.No risks found
Could it bypass safety checks?Looks for skipped website security checks, excessive file access, or actions that skip your approval.Risks found: 1
High risk

The first person to sign in can take administrator control of a new deployment

Source references: 4
What we found

Without a preconfigured secret, invitation, or owner confirmation, the system automatically makes the first authenticated user an administrator. The role-management capability relies on an internal check that the caller is already an administrator.

Why this matters

If the real owner is not first after a public deployment, another person may obtain the highest privilege and control roles, administrator-protected data, and administrator-only actions.

The source supports this risk: the first authenticated login automatically becomes administrator without a token, secret, or owner confirmation. A role-assignment API exists and is protected by the caller's current admin status. If a new deployment is publicly reachable before the intended owner signs in, another person could obtain role-management authority. Users can ask for a preconfigured admin, invitation flow, or owner-claim step, and restrict access until initialization is complete.

SKILL.md:39In the instructionsOpen original file
  public func initState() : AccessControlState;  public func getUserRole(state : AccessControlState, caller : Principal) : UserRole;  public func assignRole(state : AccessControlState, caller : Principal, user : Principal, role : UserRole);  public func isAdmin(state : AccessControlState, caller : Principal) : Bool;  public func hasPermission(state : AccessControlState, caller : Principal, requiredRole : UserRole) : Bool;};
Show 3 other places
SKILL.md:46In the instructionsOpen original file
Initialization is handled internally by `MixinAuthorization` -- do not call `initialize` directly. The first authenticated user to log in automatically becomes admin; no token or secret is required.
SKILL.md:170In the instructionsOpen original file
- Anonymous principals are treated as guests.- `assignRole` includes an admin-only guard internally.- Use `shared({ caller })` for authenticated endpoints that modify data.
SKILL.md:40In the instructionsOpen original file
  public func getUserRole(state : AccessControlState, caller : Principal) : UserRole;  public func assignRole(state : AccessControlState, caller : Principal, user : Principal, role : UserRole);  public func isAdmin(state : AccessControlState, caller : Principal) : Bool;
Could it mislead the AI or hide text?Checks the skill instructions for requests to ignore you, influence the report, or hide text in invisible characters.No risks found
Could it change links or payment recipients without asking?Looks for forced referral or payment changes combined with instructions to hide the change.No risks found

Inside this skill

2 instruction sections

The Skill adds admin, user, and guest roles through an external Motoko package and `MixinAuthorization`; each application endpoint must still invoke an appropriate permission check.

View source
SKILL.md:24In the instructionsOpen original file
There is a prefabricated library `mo:caffeineai-authorization/access-control.mo`. It provides core authentication with role-based access control.
SKILL.md:151In the instructionsOpen original file
Apply the appropriate guard to every public function:

The profile example lets ordinary users read and write their own profiles, while only administrators may read another principal's profile.

View source
SKILL.md:133In the instructionsOpen original file
  public shared ({ caller }) func saveCallerUserProfile(profile : Types.UserProfile) : async () {    if (not AccessControl.hasPermission(accessControlState, caller, #user)) {      Runtime.trap("Unauthorized");    };    userProfiles.add(caller, profile);  };
SKILL.md:140In the instructionsOpen original file
  public query ({ caller }) func getUserProfile(user : Principal) : async ?Types.UserProfile {    if (caller != user and not AccessControl.isAdmin(accessControlState, caller)) {      Runtime.trap("Unauthorized: Can only view your own profile");    };    userProfiles.get(user);  };};

If an application configures the optional callback, sign-in supplies verified name, email, and SSO-domain attributes. The example persistently stores email by principal and exposes a getter for the current caller's email.

View source
SKILL.md:178In the instructionsOpen original file
`MixinAuthorization` can capture the user's verified Internet Identity attributes (name and email) at sign-in. Pass a callback as the second argument instead of `null`; it runs once per sign-in, after the attribute bundle has been verified.
SKILL.md:211In the instructionsOpen original file
  let emails : Map.Map<Principal, Text>;  include MixinAuthorization(    accessControlState,    ?(func(caller : Principal, attrs : { name : ?Text; email : ?Text; sso : ?Text }) {      switch (attrs.email) {        case (?email) { emails.add(caller, email) };        case null {};      };    }),  );  public query ({ caller }) func getCallerEmail() : async ?Text {    emails.get(caller);  };

The migration requires upgrading backend and frontend dependencies and running `mops install`. The supplied source does not include those packages' implementations, so their internal authorization and attribute-verification logic cannot be reviewed from this evidence.

View source
migration/v0.x.y-to-v1.x.y.md:46In the instructionsOpen original file
The II attribute flow (nonce, `requestAttributes`, `_internet_identity_sign_in_finish`) is handled by `@caffeineai/core-infrastructure`. Apps using `caffeineai-authorization ^1.0.0` on the backend must also run `@caffeineai/core-infrastructure ^1.0.0` on the frontend.
migration/v0.x.y-to-v1.x.y.md:54In the instructionsOpen original file
- [ ] Ensure the frontend runs `@caffeineai/core-infrastructure ^1.0.0` (see core-infrastructure migration)- [ ] Run `mops install` and verify the backend compiles without errors
Start here · InstructionsSKILL.md
extension-authorization
Lines connect the instruction file to its sections, not an observed execution order. Select a section to read the source.

File reference map

References: 1
Files making referencesReferenced content
Lines show actual file references, not execution order. Select a node to highlight its connections and inspect the files and source locations. Dashed lines include files that still need locating.
Files and check records2 files

Coverage and gaps

Content covered in each file

These are the source ranges included in this check, not a guarantee that every issue has been resolved.

  • SKILL.mdFull text included
  • migration/v0.x.y-to-v1.x.y.mdFull text included

This report is for the version above. We read the available code and instructions without running the skill or checking extra packages it installs. This is not a promise of safety: a different version or setup may behave differently.

  • SKILL.mdInstructions
  • migration/v0.x.y-to-v1.x.y.mdSupporting file

Operations mentioned in code and instructions

Connect to websites
SKILL.md:14In the instructionsOpen original file
# AuthorizationAuthorization extendsion for [Caffeine AI](https://caffeine.ai?utm_source=caffeine-skill&utm_medium=referral).
Read files
SKILL.md:266In the instructionsOpen original file
Rules:- On login, if the user already has a profile, do not ask for the name again- Display the user's profile name instead of the principal id
Lines read
445
File checksum (to compare versions)
d19f0204e0dfa84c33fe812ea87363d3a3e806bb2ed5ec1a8896c67db87bc4f5