
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@mirrorworld/approval.middleware
Advanced tools
This middleware is used to authorize actions executed by users. This prevents external entities from performing actions on behalf of users. The way it works is that the user approves an action, which creates a token that is valid for 60 seconds on the Mirror World SSO.
This token should then be used to authenticate the user's action on the target service.
yarn add @mirrorworld/approval.middleware
import myRedisClient from '../path/to/redis';
import { ActionApprovalClient } from '@mirrorworld/approval.middleware';
const secret = process.env.MY_JWT_SECRET;
const algorithm = process.env.MY_JWT_ALGORITHM;
// 1. Create Action approval client
const approvalClient = new ActionApprovalClient({
redisClient: myRedisClient,
jwt: {
secret: secret,
algorithm: algorithm,
},
});
// 2. Create middleware instance
const approvalMiddleware = approvalClient.createValidateActionMiddleware(
'x-authorization-token',
'x-api-req-approval'
);
// 3. Add middleware to request
router.post('/v1/transfer', approvalMiddleware, async (req, res, next) => {
// Execute authorized action transfer
});
export type ActionType =
| 'mint_nft'
| 'update_nft'
| 'transfer_sol'
| 'transfer_spl_token'
| 'create_collection'
| 'create_sub_collection'
| 'list_nft'
| 'buy_nft'
| 'cancel_listing'
| 'update_listing'
| 'transfer_nft'
| 'interaction'
| 'create_marketplace'
| 'update_marketplace'
| 'transfer_bnb'
| 'transfer_matic'
| 'transfer_eth'
| 'transfer_erc20_token'
| 'sign_transaction'
| 'personal_sign'
| 'sign_typed_data'
| 'sign_typed_data_with_version';
FAQs
Medusa SDK Core
The npm package @mirrorworld/approval.middleware receives a total of 8 weekly downloads. As such, @mirrorworld/approval.middleware popularity was classified as not popular.
We found that @mirrorworld/approval.middleware demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.