Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: catch JSON stringified #1267

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

baruchiro
Copy link
Contributor

Description:

I have a code sample when someone writting a hard-coded JSON as string, and it looks like this:

var json = "{ \"access-key\": \"access key here\" }"

Checklist:

  • Does your PR pass tests?
  • Have you written new tests for your changes?
  • Have you lint your code locally prior to submission?

@rgmz
Copy link
Contributor

rgmz commented Sep 11, 2023

I'd recommend making the escape slash more repeatable than other symbols. I've encountered several instances of nested escaped JSON, which does not get detected otherwise.

@baruchiro
Copy link
Contributor Author

@rgmz Give me an example and I will TDD it :-)

baruchiro added a commit to Checkmarx/gitleaks that referenced this pull request Mar 28, 2024
### Description:
I have a code sample when someone writting a hard-coded JSON as string,
and it looks like this:
```java
var json = "{ \"access-key\": \"access key here\" }"
```

### Checklist:

* [x] Does your PR pass tests?
* [x] Have you written new tests for your changes?
* [x] Have you lint your code locally prior to submission?

Original: gitleaks#1267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants