View Issue Details

IDProjectCategoryView StatusLast Update
0008783Talermerchant portal webuipublic2024-05-15 16:01
ReporterChristian Grothoff Assigned Tosebasjm Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.11Fixed in Version0.11 
Summary0008783: merchant SPA fails to URL encode bearer token
DescriptionFlorian reported that the merchant backend hangs when trying to set the following password: "@;#.G?gFT=%G;7a"

I investigated, and this *was* a problem in libgnunetutils' URL decoder, that failed baldy when the input wasn't URL-encoded, and "%G" isn't "%" followed by a 2-digit number ;-).

However, after fixing the URL decoder, this still leaves an issue in the SPA, as the Authorization header should be URL-encoded. Otherwise, the user could enter tokens that basically break the HTTP protocol because of use of characters that just should not be in an HTTP header. Basically, only printable ASCII (7-bit) is 'safe' for HTTP headers (see https://www.rfc-editor.org/rfc/rfc7230#section-3.2.4). As users could use "anything" in passwords, the SPA needs to URL-encode them before submission.

The backend always did URL decoding already...

This may also explain some of my more spectacular failures to set/reset passwords.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

sebasjm

2024-05-03 12:20

developer   ~0022335

creating the instance works

curl 'http://merchant.taler.test:1180/management/instances' \
  -H 'Authorization: Bearer secret-token:E2BQ184AG4HJKKT4CFRXR1YAM0WCK39HXYZN8JVMEK5MKGPTYM7G' \
  --data-raw '{"id":"eee","user_type":"business","use_stefan":true,"default_pay_delay":{"d_us":7200000000},"default_wire_transfer_delay":{"d_us":172800000000},"name":"eee","auth":{"method":"token","token":"secret-token:%25%25%25"},"address":{},"jurisdiction":{}}' \

but getting the token doesn't

curl 'http://merchant.taler.test:1180/instances/eee/private/token' \
  -H 'Authorization: Bearer secret-token:%25%25%25' \
  --data-raw '{"scope":"write","duration":{"d_us":"forever"},"refreshable":true}'
{
  "code": 43,
  "hint": "The service refused the request as the given authorization token is malformed."
}

SPA is encoding the user input after 20353eda2..5db79542f

sebasjm

2024-05-03 14:49

developer   ~0022337

When the token endpoint works, please assign it back to me so I can check the SPA before making a prebuilt

Christian Grothoff

2024-05-03 15:07

manager   ~0022338

Eh, it shouldn't be URL-encoded in the JSON! Only in the HTTP header!

sebasjm

2024-05-06 16:14

developer   ~0022361

fixed in bf03157b6..f062d9f77

Issue History

Date ModifiedUsernameFieldChange
2024-05-01 07:39Christian GrothoffNew Issue
2024-05-01 07:39Christian GrothoffStatusnew => assigned
2024-05-01 07:39Christian GrothoffAssigned To => sebasjm
2024-05-03 12:20sebasjmNote Added: 0022335
2024-05-03 12:20sebasjmAssigned Tosebasjm => Christian Grothoff
2024-05-03 14:49sebasjmNote Added: 0022337
2024-05-03 15:07Christian GrothoffNote Added: 0022338
2024-05-03 15:07Christian GrothoffAssigned ToChristian Grothoff => sebasjm
2024-05-06 16:14sebasjmStatusassigned => informing
2024-05-06 16:14sebasjmResolutionopen => fixed
2024-05-06 16:14sebasjmNote Added: 0022361
2024-05-15 15:53Christian GrothoffFixed in Version => 0.11
2024-05-15 16:01Christian GrothoffStatusinforming => closed
2026-08-23 14:18Florian DoldCategorymerchant backoffice SPA => merchant portal webui