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.
This package is an asynchronous implementation of the new Envato API and provides an easy interface for accessing all applicable methods. At the moment, this package only supports personal token authentication, not OAuth.
I wanted an easy wrapper for the Envato API which would simplfy the way you pass variables and handle errors automatically, returning a raw JSON response. This package does just that.
npm install --save envato-api
First you must require the package into your module. Note that the package exports a function which is used for setting your personal token and user agent.
Be sure to replace the two variables.
PERSONAL_TOKEN
is the secret token you retrieved from https://build.envato.com/my-apps.USER_AGENT
is a description of your script only visible to the Envato API team. You should include your contact email and a short description of what your script does.var EnvatoAPI = require('envato-api')('PERSONAL_TOKEN', 'USER_AGENT');
Each method is detailed at https://build.envato.com/api/. All parameter names are the same, and should be passed inside an object.
getCollection({ id: 1234 })
getItem({ id: 1234 })
searchItems({ site: 'codecanyon', term: 'query', ... })
searchComments({ item_id: 1234, term: 'query', ... })
getPopularItems({ site: 'codecanyon' })
getCategories({ site: 'codecanyon' })
getItemPrices({ item_id: 1234 })
getNewItems({ site: 'graphicriver', category: 'graphics' })
getFeaturedItems({ site: 'graphicriver' })
getRandomNewFiles({ site: 'graphicriver' })
getUserCollections()
getPrivateCollection({ id: 567890 })
getUsersDetails({ username: 'collis' })
getUsersBadges({ username: 'collis' })
getUsersItems({ username: 'collis' })
getUsersNewItems({ username: 'collis', site: 'graphicriver' })
getSales({ page: 1 })
getSaleByCode({ code: '123-456-789' })
getPurchases({ page: 1 })
getPurchaseByCode({ code: '123-456-789' })
getPrivateUserDetails()
getUsername()
getEmail()
getSalesByMonth({ ... })
getTotalMarketUsers()
getTotalMarketItems()
getTotalFilesBySite({ site: 'codecanyon' })
Each method will return a Promise
which will resolve with the parsed JSON object or reject with an error.
The output is not modified, so the output is the same as on build.envato.com.
EnvatoAPI.getUsername().then(
function (response) {
console.log('Current user is:', response.username);
},
function (error) {
console.log('Error:', error.message);
}
);
The error.message
property will contain the following under these circumstances:
Bad Request
when invalid parameters are sent or required parameters are missing.Unauthorized
when the personal token is invalid.Access Denied
when you've reached your rate limit or are banned.Not Found
when no matches or results were found by the endpoint.Internal Server Error
when the API is experiencing problems.Request Error: <message>
when there's an error executing the HTTP request.
Error code <000>: <message>
when another HTTP code is received than those above.FAQs
Easily interact with the Envato Market API using a personal token.
The npm package envato-api receives a total of 1 weekly downloads. As such, envato-api popularity was classified as not popular.
We found that envato-api 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.
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.