Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
gulp-md5-includes
Advanced tools
Adds Soft MD5 suffix to files which included in a main HTML
file
this forces the browser to re-fetch new files that are already cached
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="utf-8">
<link href="assets/style.css" rel="stylesheet"/>
</head>
<body>
<h1>Hello World</h1>
<script src="assets/scripts.js"></script>
</body>
</html>
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="utf-8">
<link href="assets/style.css?eb6d8713c185988b8d6e1dfdf412a6bf" rel="stylesheet"/>
</head>
<body>
<h1>Hello World</h1>
<script src="assets/scripts.js?3131354f5733fc16f92093dfd42f78c8"></script>
</body>
</html>
First, install gulp-md5-includes
as a development dependency:
npm install --save-dev gulp-md5-includes
Then, add it to your gulpfile.js
:
var gulp = require('gulp');
var md5Includes = require('gulp-md5-includes');
gulp.task('md5', function () {
gulp.src("./index.tpl.html")
.pipe(md5Includes(['assets/style.css', 'assets/scripts.js'], 'index.html'))
.pipe(gulp.dest("./dist"));
});
var gulp = require('gulp');
var md5Includes = require('gulp-md5-includes');
gulp.task('md5-advanced', function () {
gulp.src("./index.tpl.html")
.pipe(md5Includes([
{
path: 'assets/style.css',
pattern: 'advanced/configuration/path/style.css'
},
{
path: 'assets/scripts.js',
pattern: 'advanced/configuration/path/scripts.js'
}],
'index-advanced.html'))
.pipe(gulp.dest("./dist"));
});
md5Includes(includes,newName)
includes
Type:
Array
Default: nullThe included files you wish to hash in your
HTML
file can bestring
orobject
newName
Type:
String
Default: nullOptional: html new name
FAQs
Hashing resource files like a boss
The npm package gulp-md5-includes receives a total of 1 weekly downloads. As such, gulp-md5-includes popularity was classified as not popular.
We found that gulp-md5-includes demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.