Kong / Kong/insomnia

Incorrect escaping of query parameter

Open
#7,039 3 comments 0 reactions 0 assignees View on GitHub
B-bug S-unverified
Dominant language
TypeScript
Stars
40k
Forks
2.4k
Avg merge
2d 13h
Merged PRs (30d)
61

Description

### Expected Behavior

When passing a string containing the `%` sign as a query param, i ran into the following issue
the following will be incorrectly escaped:
?test=%ae%

it turns into:
?test=%ae%25

So only the first percentage sign seems to be escaped.

### Actual Behavior

it seems as the following combinations after the percentage sign will cause it to not escape correctly:

- aa
- ab
- ac
- ad
- ae
- af
- ba
- bb
- bc
- bd
- be
- bf
- ca
- cb
- cc
- cd
- ce
- cf
- da
- db
- dc
- dd
- de
- df
- ea
- eb
- ec
- ed
- ee
- ef
- fa
- fb
- fc
- fd
- fe
- ff

any of these combinations after % will not escape the % correctly

i.e. %aa => %aa (instead of %25aa)

### Reproduction Steps

use % followed by any of the above mentioned combinations in a query parameter

### Is there an existing issue for this?

- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.

### Additional Information

_No response_

### Insomnia Version

2023.5.8

### What operating system are you using?

Windows

### Operating System Version

Windows 11

### Installation method

exe

### Last Known Working Insomnia version

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the query-parameter behavior described for Insomnia 2023.5.8 on Windows 11, using a value containing `%` followed by each listed hexadecimal pair. Done means those combinations are escaped consistently, including `%aa` becoming `%25aa`, with regression coverage for the reported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.