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.
@pazznetwork/strophets
Advanced tools
Strophe.ts is a JavaScript library for speaking XMPP via BOSH (XEP 124 and XEP 206) and WebSockets (RFC 7395).
Its primary purpose is to enable web-based, real-time XMPP applications that run in any browser.
last 2 Chrome version last 2 Firefox version last 2 Edge major versions last 2 Safari major versions last 2 iOS major versions Firefox ESR not IE 11
It is licensed under the MIT license
Strophe.js was originally created by Jack Moffitt. It was originally developed for Chesspark, an online chess community based on XMPP technology. It has been cared for and improved over the years as a main package strophe.js for converse.js. Strophe.ts is an effort of moving this package into the typescript landscape with a browser first mentality to simplify building new XMPP chat clients on top of it.
import { Connection } from './connection';
import { $msg } from './builder-helper';
const domain = 'xmpp.service.top-level-domain';
const myJid = 'local-user@' + domain;
const conn = await Connection.create('wss://service.top-level-domain', domain);
await conn.login(myJid, 'very-secret-password-now!');
const msg = $msg({
from: myJid,
to: 'friend@' + domain,
xmlns: 'jabber:client',
})
.c('body')
.t('Hello my Friend!')
.tree();
conn.send($msg({}));
Server Administrators can allow in-band registration through anonymous connections. This is in simple setups discouraged to avoid spam but otherwise great for testing or also great as a feature with proper Verification and permission management.
import { Connection } from './connection';
import { $msg } from './builder-helper';
const domain = 'xmpp.service.top-level-domain';
const myJid = 'local-user@' + domain;
const service = 'wss://service.top-level-domain';
const conn = await Connection.create(service, domain);
conn.register(myJid, 'very-secret-password-now!', service, domain);
After creating a connection you can set the function fields Connection.xmlInput
and Connection.xmlOutput
for logging, the default functions do nothing.
Due to limitations of current Browsers' XML-Parsers the opening and closing
<stream>
tag for WebSocket-Connections will be passed as self-closing in these calls.
BOSH-Connections will have all stanzas wrapped in a tag. You can extend your implementation to strip the tag if you want.
import { Connection } from './connection';
import { $msg } from './builder-helper';
const domain = 'xmpp.service.top-level-domain';
const myJid = 'local-user@' + domain;
const conn = await Connection.create('wss://service.top-level-domain', domain);
await conn.login(myJid, 'very-secret-password-now!');
The SHA Authentications are in general the default authentication method for XMPP. It is used for SASL authentication after negotiating the supported mechanism.
As the implementation of the SHA-1 to SHA-512 algorithms is based on the WebCrypto API, it is not available in all browsers. Also in some browsers it is not available in a WebWorker context or a Unsafe Context.
Meaning if the Chat is not used in a SSL context one has no access to the web crypto and we have to fall back to plain and the other authentication methods.
FAQs
Strophe.ts is an XMPP library for TypeScript
We found that @pazznetwork/strophets 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
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.