You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PayloadMasker leaks values in five input shapes #320
PayloadMasker (dari/src/main/kotlin/com/easyhooon/dari/masking/PayloadMasker.kt) leaves sensitive values visible in five input shapes. Found while adding edge-case tests in #318 / #319.
Problem
#
Input
Output today
What leaks
1
[{"name":"Authorization","value":"xyz"}]
unchanged
Header value in name/value pair arrays (HAR-style headers)
2
Cookie: a=1; sid=2
Cookie: ***; sid=2
Every cookie pair after the first
3
password: my secret pass
password: *** secret pass
Rest of an unquoted multi-word value in plain text
4
{"비밀번호":"x","토큰":"y"}
unchanged
Non-English key names
5
{"X-Auth":"k","credential":"k","private_key":"k"}
unchanged
Keys outside SENSITIVE_KEY_PARTS / SENSITIVE_KEYS
Masking is opt-in and meant to keep credentials off shared screens and exports, so each of these defeats it for apps that use that shape.
Proposed Approach
Each fix trades leaks for false positives, so decide per case:
Name/value pairs: when an object has a name/key field whose value is a sensitive key, mask its sibling value. Low false-positive risk.
Cookie header: when the key is cookie / set-cookie, mask to end of line instead of the first ;.
Unquoted plain text: mask to end of line for key: value lines. Risks hiding non-sensitive text on the same line.
Non-English keys: add a small list (비밀번호, 토큰, 인증?) or leave to setPayloadRedactor on iOS / a future Android hook.
More keys: candidates auth, credential, privatekey, signature. auth alone would also match author, so it needs an exact match like the short keys.
Add a failing test per accepted case to PayloadMaskerTest before changing the matcher.
Cases 2, 3, 4 and the header tuple/flat-array shapes: won't fix in the built-in masker. Cookie headers, HAR-style header lists and unquoted multi-word text rarely appear in bridge payloads, and each fix would add false positives. Apps that do send these shapes should handle them with a custom redactor (setPayloadRedactor on iOS; an Android equivalent can be tracked separately).
Activity
easyhooon commentedon Nov 23, 2026
Two more header shapes still leak after fixing #1 (
name/valueobjects); onlyBearer/Basicvalues are caught in them:Array.from(headers.entries()):[["authorization","x"],["x-api-key","k"]]rawHeaders["Authorization","x"]or OkHttpHeadersserialized by Gson:{"namesAndValues":["Cookie","sid=1"]}Masking the element after a sensitive string in an array would cover both, at the cost of false positives in plain string lists.
easyhooon commentedon Dec 5, 2026
Scope decision: dari inspects bridge payloads, which are app-defined JSON, not raw HTTP traffic.
setPayloadRedactoron iOS; an Android equivalent can be tracked separately).