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

New Published Rules - aaronmiller_personal_org.node-uuid-v1-usage #3522

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions aaronmiller_personal_org/node-uuid-v1-usage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
print("Welcome to Semgrep!" + "Use our Run button to start experimenting -->")


print("...")

# To detect ALL calls to the print() function, change the Semgrep Rule from print("...") to print(...)

print(not_a_string)

print(first_var, second_var)

print()

# print("This is commented out so it will never be found")
30 changes: 30 additions & 0 deletions aaronmiller_personal_org/node-uuid-v1-usage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
rules:
- id: node-uuid-v1-usage
pattern-either:
- pattern: |
$UUID.v1()
- pattern: |
require('uuid').v1()
- pattern: |
import { v1 } from 'uuid'
message: UUID v1 usage detected. Prefer UUID v4 for better security properties.
languages:
- javascript
- typescript
severity: WARNING
fix-regex:
regex: v1
replacement: v4
metadata:
category: security
subcategory:
- guardrail
cwe:
- 'CWE 330: Use of Insufficiently Random Values'
confidence: HIGH
likelihood: MEDIUM
impact: HIGH
technology:
- nginx
references:
- https://medium.com/appsec-untangled/lessons-learned-3-is-your-random-uuid-really-random-1a8a62207c8b
Loading