Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
github.com/tsurai/jantar
Jantar is a lightweight mvc web framework with emphasis on security written in golang. It has initially been largely inspired by Martini but prefers performance over syntactic sugar and aims to provide crucial security settings and features right out of the box.
WARNING: This project is deprecated and is not maintained anymore. The default security settings and feature are out of date and not secure anymore! Use this as reference only!
First you have to download and install the package into the import path. This can easily be done with go get:
go get github.com/tsurai/jantar
Now you can import jantar and create a simple website
package main
import (
"net/http"
"github.com/tsurai/jantar"
)
func main() {
j := jantar.New(&jantar.Config {
Hostname: "localhost",
Port: 3000,
})
j.AddRoute("GET", "/", func(respw http.ResponseWriter, req *http.Request) {
respw.Write([]byte("Hello World"))
})
j.Run()
}
Using Controller and rendering Templates is very easy with Jantar. For this simple example I'm going to assume the following directory structure. A detailed description will follow soon.
|- controllers/
|-- app.go
|- views/
|-- app/
|--- index.html
| main.go
-- controllers/app.go
package controller
import (
"github.com/tsurai/jantar"
)
type App struct {
jantar.Controller
}
func (c *App) Index() {
c.Render()
}
-- views/app/index.html
<h1>Hello Controller</h1>
-- main.go
package main
import (
"github.com/tsurai/jantar"
c "controllers"
)
func main() {
j := jantar.New(&jantar.Config {
Hostname: "localhost",
Port: 3000,
})
j.AddRoute("GET", "/", (*c.App).Index)
j.Run()
}
Jantar is by no means secure in the literal sense of the word. What it does is providing easy and fast ways to protect against the most common vulnerabilities. Security should never be left out because it is too troublesome to implement.
Some might wonder why Jantar is using /dev/urandom instead of the seemingly more secure /dev/random. Please take some minutes and read this interesting article about /dev/urandom/
These frameworks have been a source of inspiration and ideas during Jantars development.
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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.