View Issue Details

IDProjectCategoryView StatusLast Update
0010172Talermerchant backendpublic2025-07-09 20:37
Reportersebasjm Assigned Tosebasjm  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status feedbackResolutionopen 
Summary0010172: should not be able to create to create tokens with a token
DescriptionThis works, and I can use the token returned to create more tokens (on any scope)

$ curl 'http://merchant.taler.test/private/token' -H 'Authorization: Bearer secret-token:GVP8MZ2R22XGNY1KA9Q72RVMHZZ0E7K35E924ZJQECJTT0TFQ6NG' --data-raw '{"scope":"all","duration":{"d_us":"forever"}}'
{
  "access_token": "secret-token:H6QTCSWAD2458EDG09J3JCH98N63ARM0SCXKG4EM3PMP6W942CP0",
  "token": "secret-token:H6QTCSWAD2458EDG09J3JCH98N63ARM0SCXKG4EM3PMP6W942CP0",
  "scope": "all",
  "refreshable": false,
  "expiration": {
    "t_s": "never"
  }
}

The problem is that this is the normal token used by the merchant SPA. I think we should either have a special scope for tokens to create new tokens (1) or only allow the creation of tokens with Basic, not Bearer (2).

I think (2) is the simplest and safest.

We can also go for (1) for a "spa-session" scope. This allows the full management (like all) but prevents the creation of new tokens if leaked.
TagsNo tags attached.

Activities

schanzen

2025-07-09 18:07

administrator   ~0025469

You should not be able to create a token with a broader scope than the one you present. I also though it had to be refreshable. Need to check the code.

schanzen

2025-07-09 18:09

administrator   ~0025470

What is the "normal token used by the SPA"? Because we do not have a scope for that, so I guess you already have a scope with "all". So your description would not be correct. We can define a special scope for SPAs, if you can provide me with a clear requirement and set of permissions required.

schanzen

2025-07-09 18:11

administrator   ~0025471

(Note: "all" always was and still is defined as "can do anything including refresh")

schanzen

2025-07-09 18:12

administrator   ~0025472

We cannot limit the token endpoint to only Basic, because that is what ":refreshable" is about.

schanzen

2025-07-09 18:12

administrator   ~0025473

Your proposal (1) also does not work, because you can request scope "spa-session:refeshable" and get a token that can be refreshed.

Christian Grothoff

2025-07-09 20:37

manager   ~0025474

The SPA clearly should ask for a non-refreshable token, possibly with a lifetime restriction that the user can configure on login.

When the SPA is used to create *another* token for export, I think it makes sense for the SPA to require the user to re-enter username/password for this.

Maybe this is a pure SPA issue and not something that requires changes in the backend?

Issue History

Date Modified Username Field Change
2025-07-09 16:55 sebasjm New Issue
2025-07-09 17:03 Christian Grothoff Assigned To => schanzen
2025-07-09 17:03 Christian Grothoff Status new => assigned
2025-07-09 18:07 schanzen Note Added: 0025469
2025-07-09 18:09 schanzen Note Added: 0025470
2025-07-09 18:11 schanzen Note Added: 0025471
2025-07-09 18:12 schanzen Note Added: 0025472
2025-07-09 18:12 schanzen Note Added: 0025473
2025-07-09 20:37 Christian Grothoff Note Added: 0025474
2025-07-09 20:37 Christian Grothoff Assigned To schanzen => sebasjm
2025-07-09 20:37 Christian Grothoff Status assigned => feedback