guatedude2 / node-readfiles Goto Github PK
View Code? Open in Web Editor NEWA lightweight node.js module to recursively read files in a directory using ES6 Promises.
License: MIT License
A lightweight node.js module to recursively read files in a directory using ES6 Promises.
License: MIT License
Hi @guatedude2, following #7 and #9, CodeQL reported another finding (see screenshot below):
Incomplete string escaping or encoding
.lib/readfiles.js:13
Sanitizing untrusted input is a common technique for preventing injection attacks such as SQL injection or cross-site scripting. Usually, this is done by escaping meta-characters such as quotes in a domain-specific way so that they are treated as normal characters.
CodeQL
js/incomplete-sanitization
You probably see the same on your CodeQL dashboard.
Is this a true positive or false positive?
Thanks
Problem examples in README.MD
readfiles('/path/to/dir/', {
depth: 0
}, function (err, content, filename) {
readfiles('/path/to/dir/', {
filter: '*' // instead of the default '**'
}, function (err, content, filename) {
etc..
Hi @guatedude2, following #7 and #8, CodeQL reported another finding (see screenshot below):
Incomplete string escaping or encoding
.lib/readfiles.js:13
Sanitizing untrusted input is a common technique for preventing injection attacks such as SQL injection or cross-site scripting. Usually, this is done by escaping meta-characters such as quotes in a domain-specific way so that they are treated as normal characters.
CodeQL
js/incomplete-sanitization
You probably see the same on your CodeQL dashboard.
Is this a true positive or false positive?
Thanks
Title: Double escaping or unescaping
File: utils/readfiles.js:20
Tool: CodeQL
Rule ID: js/double-escaping
Query: View source
.pnpm/[email protected]/node_modules/node-readfiles/lib/readfiles.js:15
define("src/build-filter", ["require", "exports"], function (require, exports) {
^
ReferenceError: define is not defined
at Object.<anonymous> (/home/berliangur/ten25-second/ten25-third/node_modules/.pnpm/[email protected]/node_modules/node-readfiles/lib/readfiles.js:15:1)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at Module.require (node:internal/modules/cjs/loader:1057:19)
at require (node:internal/modules/cjs/helpers:103:18)
at Object.<anonymous> (/home/berliangur/ten25-second/ten25-third/first.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1155:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
document
hidden: a boolean value whether to exclude hidden files prefixed with a . (defaults to true)
68 lines of code
// skip file if it's a hidden file and the hidden option is not set
if (options.hidden !== true && /^\./.test(filename)) {
return next();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.