narvy-cli 1.3.3__tar.gz → 1.3.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/CHANGELOG.md +28 -0
- {narvy_cli-1.3.3/narvy_cli.egg-info → narvy_cli-1.3.5}/PKG-INFO +1 -1
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/__init__.py +1 -1
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios/objc/storage.yml +1 -1
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios_swift.yml +4 -1
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/java.yml +75 -28
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/python.yml +5 -5
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/secrets_supplement.yml +2 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/secret_presentation.py +727 -48
- {narvy_cli-1.3.3 → narvy_cli-1.3.5/narvy_cli.egg-info}/PKG-INFO +1 -1
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/LICENSE +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/MANIFEST.in +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/README.md +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/SECURITY.md +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/__main__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/android/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/android/source_analyzer.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/android/split_bundle.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/android_rule_context.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/apk_memory_preflight.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/auth.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cbom.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ci_templates/bitbucket.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ci_templates/github.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ci_templates/gitlab.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/aws_scan.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/gcp_scan.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/normalize.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/rule_severity.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/severity.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/cloud/upload.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/comment_filter.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/crypto_taint_lite.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/decompiler.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/doctor.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/gitlab_report.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/audit.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/host_knowledge.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/lynis_bootstrap.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/lynis_parser.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/narvy_checks.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/report.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/host/ssh_exec.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/binary_analyzer.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/plist_checks.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/source_analyzer.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/third_party_filter.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/ios/trust_all_context.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/main.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/native_hardening.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/own_reports.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/pathhint.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/pathnorm.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/proc.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/repo_identity.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/reporter.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rule_engine.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android/config.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android/crypto.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android/secrets.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android/storage.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android/webview.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/android.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios/objc/crypto.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios/objc/network.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios/objc/secrets.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/ios/objc/webview.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/go.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/javascript.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/kotlin.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/php.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/ruby.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/rust.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/rules/web/secrets.yml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sbom.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/android_deps.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/ios_deps.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/osv_client.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/osv_localdb.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/osv_semantic.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/severity_calibration.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/sca/web_deps.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/scope_config.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/secret_output.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/secret_value_grade.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/semgrep_engine.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/stack_protector_evidence.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/__main__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/analyze.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/arsc.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/axml.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/checks.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/elf.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/loader.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/protoxml.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/android/xmlmodel.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/archive.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/cli.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/data/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/data/apple.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/data/play.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/ios/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/ios/checks.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/ios/loader.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/ios/macho.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/store_check/model.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/telemetry.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/third_party_filter.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/uploader.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/weak_prng_context.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/__init__.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/nuclei_binary.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/scan_blocklist.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/scanner.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/source_analyzer.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy/web/ssrf_guard.py +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy_cli.egg-info/SOURCES.txt +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy_cli.egg-info/dependency_links.txt +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy_cli.egg-info/entry_points.txt +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy_cli.egg-info/requires.txt +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/narvy_cli.egg-info/top_level.txt +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/pyproject.toml +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/setup.cfg +0 -0
- {narvy_cli-1.3.3 → narvy_cli-1.3.5}/setup.py +0 -0
|
@@ -5,6 +5,34 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.5]
|
|
9
|
+
|
|
10
|
+
### Security
|
|
11
|
+
|
|
12
|
+
- Secret values are masked everywhere they appear in the output (JSON, SARIF,
|
|
13
|
+
GitLab, HTML): unquoted values (YAML, `.env`), cut values, values copied into
|
|
14
|
+
other findings, URL passwords and PEM blocks. A finding keeps a short visible
|
|
15
|
+
prefix/suffix, the length and a SHA-256 fingerprint.
|
|
16
|
+
|
|
17
|
+
## [1.3.4]
|
|
18
|
+
|
|
19
|
+
### Fixed
|
|
20
|
+
|
|
21
|
+
- Secrets: a high-entropy value whose name ends in `PUBKEY` / `PUB_KEY` (a
|
|
22
|
+
public key) is no longer reported. Names like `SIGNING_SECRET_KEY` still are.
|
|
23
|
+
- Java zip-slip: the rule needs a real zip or jar entry (`getNextEntry()`,
|
|
24
|
+
`getNextJarEntry()`, a `ZipEntry`/`JarEntry` variable, loop or parameter) and
|
|
25
|
+
accepts a braceless `if (...) throw` check. A plain `File` is no longer
|
|
26
|
+
reported.
|
|
27
|
+
- iOS UserDefaults (Swift and Objective-C): setting names such as
|
|
28
|
+
`passwordMinLength` or `tokenExpiryInterval` are no longer reported as
|
|
29
|
+
sensitive data.
|
|
30
|
+
- Python deserialization (pickle, marshal, jsonpickle, shelve, zipfile
|
|
31
|
+
extractall): `request` counts only as request input (`body`, `data`, `GET`,
|
|
32
|
+
`POST`, `files`, `args`, `form`, `json`...). `request.session`,
|
|
33
|
+
`request.user` and `request.META` are no longer reported;
|
|
34
|
+
`self.request.POST` now is.
|
|
35
|
+
|
|
8
36
|
## [1.3.3]
|
|
9
37
|
|
|
10
38
|
### Fixed
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
- id: IOS-OBJC-STORAGE-001
|
|
4
4
|
name: "Sensitive Data Stored in NSUserDefaults"
|
|
5
|
-
pattern: '(?i)\[[\w\s.\[\]]*userdefaults[\w\s.\]]*\s+setObject\s*:[^;]*forKey\s*:\s*@"[^"]*(password|token|secret|api[_-]?key)[^"]*"'
|
|
5
|
+
pattern: '(?i)\[[\w\s.\[\]]*userdefaults[\w\s.\]]*\s+setObject\s*:[^;]*forKey\s*:\s*@"[^"]*(password|token|secret|api[_-]?key)(?!\w*(?:type|kind|config|configuration|params|parameters|settings|options|policy|length|count|attempts|enabled|disabled|timeout|mode|style|format|visible|hidden|shown|hint|label|placeholder|interval|delay|requirement|rules|strength|expir|lifetime|generator|keyboard|prompt))[^"]*"'
|
|
6
6
|
severity: "HIGH"
|
|
7
7
|
confidence: "MEDIUM"
|
|
8
8
|
details:
|
|
@@ -354,7 +354,10 @@ rules:
|
|
|
354
354
|
category: storage
|
|
355
355
|
patterns:
|
|
356
356
|
- pattern: '$UD.set($VALUE, forKey: $KEY)'
|
|
357
|
+
# A setting ABOUT the secret (passwordGeneratorConfig, tokenExpiryInterval,
|
|
358
|
+
# passwordMinLength) is not the secret: the sensitive word must not be
|
|
359
|
+
# followed, in the same identifier, by a setting noun.
|
|
357
360
|
- metavariable-pattern:
|
|
358
361
|
metavariable: $KEY
|
|
359
362
|
patterns:
|
|
360
|
-
- pattern-regex: '(?i)"[^"]*(password|token|secret|api[_-]?key)[^"]*"'
|
|
363
|
+
- pattern-regex: '(?i)"[^"]*(password|token|secret|api[_-]?key)(?!\w*(?:type|kind|config|configuration|params|parameters|settings|options|policy|length|count|attempts|enabled|disabled|timeout|mode|style|format|visible|hidden|shown|hint|label|placeholder|interval|delay|requirement|rules|strength|expir|lifetime|generator|keyboard|prompt))[^"]*"'
|
|
@@ -516,39 +516,86 @@ rules:
|
|
|
516
516
|
confidence: MEDIUM
|
|
517
517
|
technology:
|
|
518
518
|
- java
|
|
519
|
+
# The finding is the File built from the entry name. $ENTRY must be a zip
|
|
520
|
+
# entry (getNextEntry / getNextJarEntry / ZipEntry / JarEntry):
|
|
521
|
+
# `name = file.getName(); new File(dir, name)` on a java.io.File is not Zip Slip.
|
|
522
|
+
# A canonical-path (or normalized-path) containment check on the File, braced
|
|
523
|
+
# or `if (...) throw ...;`, clears it.
|
|
519
524
|
patterns:
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
525
|
+
- pattern-either:
|
|
526
|
+
- patterns:
|
|
527
|
+
- pattern: $OUT = new File($DESTDIR, $ENTRY.getName());
|
|
528
|
+
- pattern-either:
|
|
529
|
+
- pattern-inside: |
|
|
530
|
+
$ENTRY = $ZIS.getNextEntry();
|
|
531
|
+
...
|
|
532
|
+
- pattern-inside: |
|
|
533
|
+
while (($ENTRY = $ZIS.getNextEntry()) != null) { ... }
|
|
534
|
+
- pattern-inside: |
|
|
535
|
+
ZipEntry $ENTRY = ...;
|
|
536
|
+
...
|
|
537
|
+
- pattern-inside: |
|
|
538
|
+
for (ZipEntry $ENTRY : $COLL) { ... }
|
|
539
|
+
- pattern-inside: |
|
|
540
|
+
$T $M(..., ZipEntry $ENTRY, ...) { ... }
|
|
541
|
+
- pattern-inside: |
|
|
542
|
+
$ENTRY = $ZIS.getNextJarEntry();
|
|
543
|
+
...
|
|
544
|
+
- pattern-inside: |
|
|
545
|
+
while (($ENTRY = $ZIS.getNextJarEntry()) != null) { ... }
|
|
546
|
+
- pattern-inside: |
|
|
547
|
+
JarEntry $ENTRY = ...;
|
|
548
|
+
...
|
|
549
|
+
- pattern-inside: |
|
|
550
|
+
for (JarEntry $ENTRY : $COLL) { ... }
|
|
551
|
+
- pattern-inside: |
|
|
552
|
+
$T $M(..., JarEntry $ENTRY, ...) { ... }
|
|
553
|
+
- patterns:
|
|
554
|
+
- pattern: $OUT = new File($DESTDIR, $NAME);
|
|
555
|
+
- pattern-inside: |
|
|
556
|
+
$NAME = $ENTRY.getName();
|
|
557
|
+
...
|
|
558
|
+
- pattern-either:
|
|
559
|
+
- pattern-inside: |
|
|
560
|
+
$ENTRY = $ZIS.getNextEntry();
|
|
561
|
+
...
|
|
562
|
+
- pattern-inside: |
|
|
563
|
+
while (($ENTRY = $ZIS.getNextEntry()) != null) { ... }
|
|
564
|
+
- pattern-inside: |
|
|
565
|
+
ZipEntry $ENTRY = ...;
|
|
566
|
+
...
|
|
567
|
+
- pattern-inside: |
|
|
568
|
+
for (ZipEntry $ENTRY : $COLL) { ... }
|
|
569
|
+
- pattern-inside: |
|
|
570
|
+
$T $M(..., ZipEntry $ENTRY, ...) { ... }
|
|
571
|
+
- pattern-inside: |
|
|
572
|
+
$ENTRY = $ZIS.getNextJarEntry();
|
|
573
|
+
...
|
|
574
|
+
- pattern-inside: |
|
|
575
|
+
while (($ENTRY = $ZIS.getNextJarEntry()) != null) { ... }
|
|
576
|
+
- pattern-inside: |
|
|
577
|
+
JarEntry $ENTRY = ...;
|
|
578
|
+
...
|
|
579
|
+
- pattern-inside: |
|
|
580
|
+
for (JarEntry $ENTRY : $COLL) { ... }
|
|
581
|
+
- pattern-inside: |
|
|
582
|
+
$T $M(..., JarEntry $ENTRY, ...) { ... }
|
|
583
|
+
- pattern-not-inside: |
|
|
584
|
+
$OUT = new File(...);
|
|
523
585
|
...
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
586
|
+
if (!$OUT.getCanonicalPath().startsWith(...)) { ... }
|
|
587
|
+
- pattern-not-inside: |
|
|
588
|
+
$OUT = new File(...);
|
|
527
589
|
...
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
590
|
+
if (!$OUT.getCanonicalPath().startsWith(...)) throw $EX;
|
|
591
|
+
- pattern-not-inside: |
|
|
592
|
+
$OUT = new File(...);
|
|
532
593
|
...
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
594
|
+
if (!$OUT.toPath().normalize().startsWith(...)) { ... }
|
|
595
|
+
- pattern-not-inside: |
|
|
596
|
+
$OUT = new File(...);
|
|
536
597
|
...
|
|
537
|
-
|
|
538
|
-
'
|
|
539
|
-
- pattern-not: '$ENTRY = $ZIS.getNextEntry();
|
|
540
|
-
|
|
541
|
-
...
|
|
542
|
-
|
|
543
|
-
$OUT = new File($DESTDIR, $ENTRY.getName());
|
|
544
|
-
|
|
545
|
-
...
|
|
546
|
-
|
|
547
|
-
if (!$OUT.getCanonicalPath().startsWith(...)) { ... }
|
|
548
|
-
|
|
549
|
-
...
|
|
550
|
-
|
|
551
|
-
'
|
|
598
|
+
if (!$OUT.toPath().normalize().startsWith(...)) throw $EX;
|
|
552
599
|
- id: narvy.java.crypto.plaintext-socket-construction.plaintext-socket-construction
|
|
553
600
|
message: A plain `java.net.Socket`/`java.net.ServerSocket` is constructed directly. Everything sent or received on it travels
|
|
554
601
|
unencrypted, so anyone who can observe the network path can read or tamper with the traffic (CWE-319). This is an audit-level
|
|
@@ -1684,7 +1684,7 @@ rules:
|
|
|
1684
1684
|
'
|
|
1685
1685
|
- metavariable-regex:
|
|
1686
1686
|
metavariable: $SRC
|
|
1687
|
-
regex: (?i)(request|upload|response|download)
|
|
1687
|
+
regex: (?i)((self\.)?request(?!\.(?!(?-i:body|data|GET|POST|COOKIES|FILES|headers|args|form|json|get_json|values|get_data|read|files|cookies|stream|text|content|environ|params|json_body|matchdict|query_params|path_params)\b))|upload|response|download)
|
|
1688
1688
|
- id: narvy.python.pyramid.csrf-disabled-globally.csrf-disabled-globally
|
|
1689
1689
|
message: Pyramid's default CSRF check is turned off application-wide via `set_default_csrf_options(require_csrf=False)`.
|
|
1690
1690
|
Every unsafe-method view (POST/PUT/PATCH/DELETE) in the app loses its automatic CSRF token check unless
|
|
@@ -2746,7 +2746,7 @@ rules:
|
|
|
2746
2746
|
- pattern: jsonpickle.decode($DATA)
|
|
2747
2747
|
- metavariable-regex:
|
|
2748
2748
|
metavariable: $DATA
|
|
2749
|
-
regex: (?i)(request|upload|response|body|payload)
|
|
2749
|
+
regex: (?i)((self\.)?request(?!\.(?!(?-i:body|data|GET|POST|COOKIES|FILES|headers|args|form|json|get_json|values|get_data|read|files|cookies|stream|text|content|environ|params|json_body|matchdict|query_params|path_params)\b))|upload|response|body|payload)
|
|
2750
2750
|
- id: narvy.python.deserialization.marshal-loads-untrusted.marshal-loads-untrusted
|
|
2751
2751
|
message: '`marshal.loads()` deserializes data that is not a fixed local trusted source. `marshal` is
|
|
2752
2752
|
the format used for compiled Python bytecode - loading crafted marshal data from an untrusted source
|
|
@@ -2774,7 +2774,7 @@ rules:
|
|
|
2774
2774
|
- pattern: marshal.loads($DATA)
|
|
2775
2775
|
- metavariable-regex:
|
|
2776
2776
|
metavariable: $DATA
|
|
2777
|
-
regex: (?i)(request|upload|response|body|payload|socket|message|msg)
|
|
2777
|
+
regex: (?i)((self\.)?request(?!\.(?!(?-i:body|data|GET|POST|COOKIES|FILES|headers|args|form|json|get_json|values|get_data|read|files|cookies|stream|text|content|environ|params|json_body|matchdict|query_params|path_params)\b))|upload|response|body|payload|socket|message|msg)
|
|
2778
2778
|
- id: narvy.python.deserialization.pickle-loads-untrusted.pickle-loads-untrusted
|
|
2779
2779
|
message: '`pickle.load()`/`pickle.loads()` deserializes data that is not a fixed local trusted file
|
|
2780
2780
|
- a request body, an uploaded file, a cache/queue payload, or a network socket read. Unpickling is
|
|
@@ -2807,7 +2807,7 @@ rules:
|
|
|
2807
2807
|
- pattern: cPickle.loads($DATA)
|
|
2808
2808
|
- metavariable-regex:
|
|
2809
2809
|
metavariable: $DATA
|
|
2810
|
-
regex: (?i)(request|upload|response|body|payload|socket|redis|celery|queue|message|msg)
|
|
2810
|
+
regex: (?i)((self\.)?request(?!\.(?!(?-i:body|data|GET|POST|COOKIES|FILES|headers|args|form|json|get_json|values|get_data|read|files|cookies|stream|text|content|environ|params|json_body|matchdict|query_params|path_params)\b))|upload|response|body|payload|socket|redis|celery|queue|message|msg)
|
|
2811
2811
|
- id: narvy.python.deserialization.shelve-open-untrusted-path.shelve-open-untrusted-path
|
|
2812
2812
|
message: '`shelve.open()` is backed by `pickle` under the hood - reading a shelve database an attacker
|
|
2813
2813
|
can influence the path or contents of is the same RCE risk as calling `pickle.load()` directly (CWE-502).
|
|
@@ -2834,7 +2834,7 @@ rules:
|
|
|
2834
2834
|
- pattern: shelve.open($PATH)
|
|
2835
2835
|
- metavariable-regex:
|
|
2836
2836
|
metavariable: $PATH
|
|
2837
|
-
regex: (?i)(request|upload|user|param)
|
|
2837
|
+
regex: (?i)((self\.)?request(?!\.(?!(?-i:body|data|GET|POST|COOKIES|FILES|headers|args|form|json|get_json|values|get_data|read|files|cookies|stream|text|content|environ|params|json_body|matchdict|query_params|path_params)\b))|upload|user|param)
|
|
2838
2838
|
- id: narvy.python.code-injection.importlib-module-name-tainted.importlib-module-name-tainted
|
|
2839
2839
|
message: A module name passed to `importlib.import_module()` / `__import__()` is derived from request data. Importing a
|
|
2840
2840
|
module executes its top-level code, so an attacker who can choose the name can load and run any importable module on the
|
|
@@ -342,6 +342,8 @@ rules:
|
|
|
342
342
|
- pattern-not-regex: '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'
|
|
343
343
|
- pattern-not-regex: '[=:]\s*["''`][A-Z][A-Z0-9]*(?:_[A-Za-z0-9]+)+["''`]'
|
|
344
344
|
- pattern-not-regex: (?i)public[_-]?key\s*[=:]
|
|
345
|
+
# The PUBKEY / PUB_KEY spelling of a public key (nostr, ed25519 identity keys).
|
|
346
|
+
- pattern-not-regex: (?i)pub[_-]?key\s*[=:]
|
|
345
347
|
- pattern-not-regex: '[=:]\s*["''`]/[A-Za-z0-9_.\-]+/[A-Za-z0-9_./\-]+["''`]'
|
|
346
348
|
- metavariable-analysis:
|
|
347
349
|
analyzer: entropy
|