Skip to content

Add security rules for detecting hard-coded secrets in TypeScript apps #77

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

Merged
merged 11 commits into from
Jan 7, 2025
Merged
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
71 changes: 32 additions & 39 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
id: detect-angular-sce-disabled-typescript
language: typescript
severity: warning
message: >-
$sceProvider is set to false. Disabling Strict Contextual escaping
(SCE) in an AngularJS application could provide additional attack surface
for XSS vulnerabilities.
note: >-
[CWE-79] Improper Neutralization of Input During Web Page Generation.
[REFERENCES]
- https://docs.angularjs.org/api/ng/service/$sce
- https://owasp.org/www-chapter-london/assets/slides/OWASPLondon20170727_AngularJS.pdf
rule:
kind: expression_statement
regex: ^\$sceProvider
has:
kind: call_expression
stopBy: end
all:
- has:
kind: member_expression
nthChild: 1
all:
- has:
kind: identifier
regex: ^\$sceProvider$
- has:
kind: property_identifier
regex: ^enabled$
precedes:
kind: arguments
has:
kind: 'false'
nthChild: 1
not:
has:
nthChild: 2
Loading