[Bug]: Topology functions do not require a trusted context for unimpersonated tokens

Open
#6,253 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
authorization

Research direction

Reproduce by calling getTokenVBL(getSelected) from a player client on a token the player does not own, as the report describes. Compare the topology lookup functions with the other token lookups, which already require a trusted context, and find where the check is missing. Done when an untrusted player is refused for unimpersonated tokens they do not own, while the GM and owners still succeed.

Written by the indexing model from the issue text.

Description

bug
Describe the Bug

The token topology functions (e.g., getTokenVBL()) allow getting the topology from another token by provide the token's ID. Unlike most other look ups, this does not require a trusted context, meaning any player get the information regardless of whether they own the token.

To Reproduce
  1. Start a new campaign, and start a server as a GM.
  2. Join the server with a player client.
  3. Drop a token on the map. Make sure it is not owned by the player, and add some VBL to it.
  4. On the GM client (host):
    • Select the token.
    • Get the token's VBL: [r: getTokenVBL(getSelected)]
    • This should rightfully succeed since GMs can do anything.
  5. On the player client:
    • Select the token.
    • Get the token's VBL: [r: getTokenVBL(getSelected)]
    • This will succeed despite the player not having necessary permissions..
Expected Behaviour

It should not be possible to get another unimpersonated token's topology from an untrusted context.

Screenshots

No response

MapTool Info

MapTool 1.18.8

Desktop

Linux 22.3

Additional Context

I believe this behaviour goes back a long ways, it's not new in 1.18.

Dominant language
Java
Stars
927
Forks
286
Avg merge
3d 17h
Merged PRs (30d)
94

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RPTools/maptool

All issues in RPTools/maptool

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.