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/markelmad/autocomplete-test-emapta
This is a simple test of an Autocomplete web service for Emapta-Zesty.io. The purpose is to return a list of Shakespeare's works based on the fragment that the user will provide or input. In this case, we will be using a query to simulate user's input. Shakespeare's works' list will be extracted from a JSON file. Each item on the JSON file contains only 2 itemms.
{
"Title": "Title of the work",
"ReadCount": 0
}
The result is based on how frequent the user has accessed an item which is the ReadCount
. If more than 1 item have equal frequency, the service will then lookup for the closest Title
from the fragment provided. If still more than 1 item are equal, result will now be based alphabetically. Moreover, result is limited to 25 results only. This limit can be adjusted by modifying the constant value of the resultLimit
inside main.go file.
Feel free to edit the JSON file. Update each ReadCount
values to your likings. I already updated a couple of ReadCount
values for Twelfth Night (4)
and Two Gentlemen of Verona(3)
so results will more likely to show these two Titles
. The rest are valued 0
.
You can also update the threshold for determining the amount of levenshtein distance by modifying the multiplier value of thresholdMultiplier
inside main.go.
go run main.go
and hit Enter. If no errors, server is already running.docker build -t <NameYourImage> .
.docker run -p 9000:9000 -tid <NameYourImage>
.curl http://localhost:9000/autocomplete?term=th
in a terminal window and hit Enter.These are the results based on the test run that I did on my end:
Twelfth Night
Two Gentlemen of Verona
Taming of the Shrew
Tempest
Timon of Athens
Titus Andronicus
Troilus and Cressida
Troilus and Cressida
King John
King Lear
Midsummer Night's Dream
Pericles
Richard II
Richard III
Timon of Athens
Titus Andronicus
Winter's Tale
None
Julius Caesar
Much Ado about Nothing
Winter's Tale
All's Well That Ends Well
Antony and Cleopatra
As You Like It
Troilus and Cressida
All's Well That Ends Well
Henry IV, Part I
Henry IV, Part II
Henry V
Henry VI, Part I
Henry VI, Part II
Henry VI, Part III
Henry VIII
Measure for Measure
Merchant of Venice
Merry Wives of Windsor
Pericles
Tempest
Henry IV, Part I
Henry IV, Part II
Henry V
Henry VI, Part I
Henry VI, Part II
Henry VI, Part III
Henry VIII
Measure for Measure
Merchant of Venice
Merry Wives of Windsor
Pericles
Tempest
All's Well That Ends Well
Pericles
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.