Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Remixml is an XML/HTML macro language/template engine.
The language and primitives used blend in completely with standard XML/HTML syntax and therefore integrate smoothly with existing XML/HTML syntax colouring editors.
It runs inside any webbrowser environment (starting at IE11 and up).
The engine uses browser primitives to accellerate parsing; most notably it uses documentFragments and will therefore have trouble running in a plain NodeJS environment.
In essence Remixml is a macro language that has HTML/XML-like syntax and uses special entities to fill in templates. The entities that are recognised by Remixml are always of the form: &scope.varname; I.e. they distinguish themselves from regular HTML entities by always having at least one dot in the entity name.
The following sample code will illustrate the point:
Remixml.parse('<h1>Title of &_.sitename; for &_.description;</h1>'
+ '<p at="&anything.whatever;"> Some global variables &var.some; '
+ 'or &var.globalvars; or'
+ ' &var.arrays.1; or &var.arrays.2; or &var.objects.foo; or '
+ '&anything.really;',
{_: {
sitename: "foo.bar",
description: "faster than lightning templates"
},
var: {
some: "other",
globalvars: 7,
arrays: ["abc", 14, "def"],
objects: {"foo":"bar", "indeed":"yes"}
},
anything: {
really: "other",
whatever: 7
}
});
& scope . variablename : encoding % formatting ;
scope
variablename
encoding
(optional)html
uric
json
none
formatting
(optional)Note: the entity reference must not contain spaces (the spaces shown above are there to clarify the format, they should not be used in a real entity reference).
<set var="" expr="" split="" join="" tag="" scope="">...</set>
Attributes:
var
expr
regexp
split
join
tag
&_._contents;
can be used to reference
the contents of the tag. All argument values are accessible
as variables from the local scope (_
). E.g. an attribute
foo="bar"
can be referenced as &_.foo;
inside the tag definition.scope
<if expr="">...</if>
Attributes:
expr
<then>...</then>
If the last truth value was true, include the content
of the then tag. Not needed for a typical if/else
construction; usually used after a for tag
to specify code that needs to included if the for tag
actually completed at least one iteration.
<elif expr="">...</elif>
Attributes:
expr
<else>...</else>
If the last truth value was false, include the content of
the else tag. Can also be used after a for to specify
code that needs to be included if the for tag did not iterate
at all.
<for from="" to="" step="" in="" orderby="" scope="">...</for>
Upon iteration the following special variables are defined:
&_._recno;
&_._index;
&_._value;
Attributes:
from
to
step
in
orderby
scope
<delimiter>...</delimiter>
Should be used inside a for loop. It will suppress its content
upon the first iteration.
<insert var="" quote="" format="" offset="" limit="" variables=""></insert>
More explicit way to access variable content instead of through
entities.
Attributes:
var
quote
format
offset
limit
variables
dump
<replace from="" regexp="" flags="" to="">...</replace>
Attributes:
from
regexp
flags
to
<trim>...</trim>
Truncates whitespace at both ends, and reduce other whitespace runs of
more than one character to a single space.
<maketag name="">...</maketag>
Attributes:
name
<attrib name="">...</attrib>
name
<eval>...</eval>
Reevaluate the content (e.g. useful to execute a tag
created with maketag).
<nooutput>...</nooutput>
Suppress output inside this tag.
<comment>...</comment>
Skip the content of this tag.
Simple assigment:
<set var="_.variablename">the new value</set>
Simple calculations:
<set var="_.variablename" expr="_.variablename + 1"></set>
Conditionals:
<if expr="_.variablename > 1">
yes
</if>
<elif expr="_.variablename == 'foobar'">
second condition valid
</elif>
<else>
otherwise
</else>
Counted loop:
<for from="1" to="42">
This is line &_._recno;<br />
</for>
Iterating through an object or array:
<set var="_.foo" split=",">aa,b,cc,d,eee,f</set>
<for in="_.foo">
This is record &_._recno; value: &_._value;<br />
</for>
Specified parameters:
template
context
$
. The local scope will always exist
as $._
and that can always be referenced using a direct _
shortcut. I.e. in Javascript $._.foo
and _.foo
will both refer
to the same variable.Exposed API-list:
template = Remixml.parse(template, context);
txt = Remixml.parse2txt(template, context);
template = Remixml.parse_tagged(template, context);
<remixml>...</remixml>
tags.domtop = Remixml.parse_document(context);
txt = Remixml.dom2txt(template);
template = Remixml.trim(template);
<trim>
tag.$.sys.lang
FAQs
XML/HTML-like macro language/template compiler engine
The npm package remixml receives a total of 72 weekly downloads. As such, remixml popularity was classified as not popular.
We found that remixml demonstrated a healthy version release cadence and project activity because the last version was released less than 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.