
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
npm install mulang
npm install -g mulang
const code = mulang.nativeCode("JavaScript", "x = 1");
code.expect("*", "Assigns:x");
// => true
code.expect("*", "Assigns:y");
// => false
code.expect("*", "Assigns:x:WithNumber:1");
// => true
code.customExpect(`
expectation "assigns 1":
assigns with 1;
expectation "assigns 2":
assigns with 2`);
// => [['assigns 1', true], ['assigns 2', false]])
const code = mulang.nativeCode("Python", "x = 1");
code.ast
// => { tag: 'Assignment', contents: [ 'x', { tag: 'MuNumber', contents: 1 } ] }
const code = mulang.nativeCode("Python", "x = 1");
const result = code.analyse({expectations: [{binding: '*', inspection: 'Declares'}, {binding: '*', inspection: 'Assigns'}]})
result.expectationResults
// => [
// { expectation: { binding: '*', inspection: 'Declares' }, result: false },
// { expectation: { binding: '*', inspection: 'Assigns' }, result: true }
//]
You can also compute code smells:
const code = mulang.nativeCode("Python", "def increment():\n\tx += 1");
const result = code.analyse({
expectations: [ {binding: '*', inspection: 'DeclaresProcedure:Increment'} ],
smellsSet: { tag: 'AllSmells' }})
result.expectationResults
// => [
// { expectation: { binding: '*', inspection: 'DeclaresProcedure:Increment' }, result: false }
// ]
result.smells
// => [
// { binding: 'increment', inspection: 'HasDeclarationTypos:Increment' }
//]
mulang.I18n.locale = 'en'
mulang.I18n.translate('*', 'Declares:foo')
// => 'solution must declare <strong>foo</strong>'
const mulang = require('mulang')
mulang.analyse({
"sample": {
"tag": "CodeSample",
"language": "Haskell",
"content": "x = z + 1"
},
"spec": {
"expectations": [
{
"binding": "Intransitive:x",
"inspection": "Uses:z"
}
],
"smellsSet": { "tag": "NoSmells" }
}
});
$ mulangjs '{
"sample" : {
"tag" : "CodeSample",
"language" : "Haskell",
"content" : "x = z + 1"
},
"spec" : {
"expectations" : [
{
"binding" : "Intransitive:x",
"inspection" : "Uses:z"
}
],
"smellsSet" : { "tag" : "NoSmells" }
}
}' | json_pp
{
"tag" : "AnalysisCompleted",
"expectationResults" : [
{
"expectation" : {
"binding" : "Intransitive:x",
"inspection" : "Uses:z"
},
"result" : true
}
],
"smells" : [],
"outputAst" : null,
"signatures" : []
}
Build and publish the package to NPM with:
$ ./ghcjslib/release.sh
You can find an online interactive version of mulang, along with its documentation here
v6.0.6 (2021-10-15)
FAQs
An intermediate language designed to perform advanced code analysis
The npm package mulang receives a total of 52 weekly downloads. As such, mulang popularity was classified as not popular.
We found that mulang demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.