wso2 / wso2/api-platform

PII Masking regex policy does not mask sensitive information as expected

Open
#1,213 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area/AIPolicies Area/Policies Aspect/API Severity/Major Type/Bug
Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Please select the area the issue is related to

Area/Policies (Policies, Policy Hub, Policy Engine etc)

Please select the aspect the issue is related to

Aspect/API (API backends, definitions, contracts, interfaces, OpenAPI)

Description

The PII Masking regex policy doesn't work as expected, information that is supposed to be masked is sent to the upstream.

Steps to Reproduce
  1. Deploy a self-hosted gateway and a sample backend to log request details in the same network
  2. Deploy and API proxy pointed to the backend
  3. Add PII Masking regex policy with the following configuration
    (piiEntity: EMAIL, piiRegex: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$)
  4. Send a request with an email in the body (e.g. tom@gmail.com)
  5. notice the logs in the backend, the email will be present in the logs
  6. Same issue is present when a regex for phone numbers is configured.
    (piiEntity: PHONE, piiRegex: ^07[0-9]{8}$)
    e.g.: 0776666666
Severity Level of the Issue

Severity/Major (Important functionality is broken. Should be prioritized. Doesn't need immediate attention)

Environment Details (with versions)

Stage

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by reproducing the issue through the self-hosted gateway, API proxy, and sample backend, using the PII Masking regex policy with the provided email and phone patterns. Trace the policy's request handling and compare the gateway input with the backend logs; it is done when configured sensitive values are absent from upstream requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.