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.
@itzraiss/bic-sydney
Advanced tools
This is a module which allows sydney to use the Copilot Image Creator to generate images for you.
A demonstration using this module with ChatGPT API and PandoraAI together.
A Node.js module that provides some 'Copilot Image Creator' functions.
npm i @timefox/bic-sydney
Create images by Copilot Image Creator, and get an iframe pointing to the page contains the images created. This method is most likely what the original Copilot browser client does. The format of {CopilotImageCreator} options is almost same as the CopilotAiClient options of '@waylaidwanderer/chatgpt-api'.
import { CopilotImageCreator } from '@timefox/bic-sydney';
import crypto from 'crypto';
// Setup the required options.
const options = {
// Necessary for some people in different countries, e.g. China (https://cn.bing.com)
host: '',
// The "_U" cookie value from Copilot.com
userToken: '',
// If the above doesn't work, provide all your cookies as a string instead
cookies: '',
// A proxy string like "http://<ip>:<port>"
proxy: '',
// (Optional) Set to true to enable `console.debug()` logging
debug: false,
// (Optional) The user agent for the network request.
userAgent: '',
};
const prompt = 'a fox plays xbox';
const messageId = crypto.randomUUID();
// Make a creation request with given prompt. With 'gencontentv3' option on, Copilot will give you the prompt
// in a message which's contentType is 'IMAGE'.
const imageIframe = new CopilotImageCreator(options).genImageIframeCsr(prompt, messageId);
imageIframe.then((result) => {
console.debug(result);
}).catch((error) => {
console.debug(error);
});
Note: If this iframe is returned to client browser, the user must be logged in to Copilot.com in order to generate the image successfully. The user's cookie is required for the polling requests of the generation process.
Create images by Copilot Image Creator, and get an iframe which uses the 'srcdoc' attribute to hold the rendered result page. This method does not require the user to have logged in to Copilot.com on the client side. The entire request process is completed by the server proxy. It's very useful for the clients can not visit the new Copilot's service directly.
import { CopilotImageCreator } from '@timefox/bic-sydney';
import crypto from 'crypto';
// Setup the required options.
const options = {
// Necessary for some people in different countries, e.g. China (https://cn.bing.com)
host: '',
// The "_U" cookie value from bing.com
userToken: '',
// If the above doesn't work, provide all your cookies as a string instead
cookies: '',
// A proxy string like "http://<ip>:<port>"
proxy: '',
// (Optional) Set to true to enable `console.debug()` logging
debug: false,
// (Optional) The user agent for the network request.
userAgent: '',
};
const prompt = 'a fox plays xbox';
const messageId = crypto.randomUUID();
// Make a creation request with given prompt. With 'gencontentv3' option on, Copilot will give you the prompt
// in a message which's contentType is 'IMAGE'.
// The onProgress is a callback function. If onProgress is provided and returns true, the request will be cancelled.
imageIframe = new CopilotImageCreator(options).genImageIframeSsr(
prompt,
messageId,
(progress) => {
if (progress?.contentIframe) {
console.debug('contentIframe:');
console.debug(progress.contentIframe);
}
if (progress?.pollingStartTime) {
console.debug(`pollingStartTime: ${progress.pollingStartTime}`);
}
},
);
imageIframe.then((result) => {
console.debug(result);
}).catch((error) => {
console.debug(error);
});
For more usage, please refer to the module's documentation.
npm run doc
It will generate the module's docs for you under ./docs.
This project is licensed under the MIT License.
FAQs
This is a module which allows sydney to use the Copilot Image Creator to generate images for you.
The npm package @itzraiss/bic-sydney receives a total of 3 weekly downloads. As such, @itzraiss/bic-sydney popularity was classified as not popular.
We found that @itzraiss/bic-sydney 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.