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: recordHookStream #711

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

feat: recordHookStream #711

wants to merge 2 commits into from

Conversation

carlbrugger
Copy link
Contributor

Please explain how to summarize this PR for the Changelog:

Tell code reviewer how and what to test:

`Rate limited, retry attempt ${attempt + 1} of ${MAX_RETRIES}`
)
const delay =
INITIAL_RETRY_DELAY * Math.pow(1.5, attempt) * (0.75 + Math.random())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nullify Code Language: TypeScript 🔵 MEDIUM Severity CWE-327

Node insecure random generator

crypto.pseudoRandomBytes()/Math.random() is a cryptographically weak random number generator.

Reply with /nullify to interact with me like another developer
(you will need to refresh the page for updates)

`Rate limited, retry attempt ${attempt + 1} of ${MAX_RETRIES}`
)
const delay =
INITIAL_RETRY_DELAY * Math.pow(1.5, attempt) * (0.75 + Math.random())

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nullify Code Language: TypeScript 🔵 MEDIUM Severity CWE-338

Rules lgpl javascript crypto rule node insecure random generator

This rule identifies use of cryptographically weak random number generators.
Using cryptographically weak random number generators like crypto.pseudoRandomBytes()
and Math.random() for security-critical tasks can expose systems to significant
vulnerabilities. Attackers might predict the generated random numbers, compromising
the integrity and confidentiality of cryptographic operations. This could lead to
breaches where sensitive data is accessed or manipulated, authentication mechanisms
are bypassed, or secure communications are intercepted, ultimately undermining the
security of the entire system or application.

Mitigation strategy:
Replace the use of these cryptographically weak random number generators with
crypto.randomBytes(), a method provided by Node.js's crypto module that
generates cryptographically secure random numbers. This method should be used
for all operations requiring secure randomness, such as generating keys, tokens,
or any cryptographic material.

Secure Code Example:

const crypto = require('crypto');
const secureBytes = crypto.randomBytes(256);
console.log(`Secure random bytes: ${secureBytes.toString('hex')}`);

Reply with /nullify to interact with me like another developer
(you will need to refresh the page for updates)

@flatfile-nullify
Copy link

flatfile-nullify bot commented Nov 26, 2024

Nullify Code Vulnerabilities

2 findings found in this pull request

🔴 CRITICAL 🟡 HIGH 🔵 MEDIUM ⚪ LOW
0 0 2 0

You can find a list of all findings here

@carlbrugger carlbrugger force-pushed the feat/record-hook-stream branch from 1dad681 to 3d9dfcc Compare November 26, 2024 19:32
) => {
return (listener: FlatfileListener) => {
listener.on('commit:created', { sheetSlug }, (event: FlatfileEvent) =>
recordReadWriteStream(callback, event, options)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the then()/catch() syntax vs async/await

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.

2 participants