Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
github.com/apexskier/httpauth
See git tags/releases for information about potentially breaking change.
This package uses the Gorilla web toolkit's sessions package to implement a user authentication and authorization system for Go web servers.
Multiple user data storage backends are available, and new ones can be implemented relatively easily.
Access can be restricted by a users' role.
Uses bcrypt for password hashing.
var (
aaa httpauth.Authorizer
)
func login(rw http.ResponseWriter, req *http.Request) {
username := req.PostFormValue("username")
password := req.PostFormValue("password")
if err := aaa.Login(rw, req, username, password, "/"); err != nil && err.Error() == "already authenticated" {
http.Redirect(rw, req, "/", http.StatusSeeOther)
} else if err != nil {
fmt.Println(err)
http.Redirect(rw, req, "/login", http.StatusSeeOther)
}
}
Run go run server.go
from the examples directory and visit localhost:8009
for an example. You can login with the username "admin" and password "adminadmin".
Tests can be run by simulating Travis CI's build environment. There's a very
unsafe script --- start-test-env.sh
that will do this for you.
You should follow me on Twitter. Appreciate this package?
FAQs
Unknown package
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.