Skip to content

Commit d6e6a56

Browse files
Downgrade peter-evans/create-pull-request to approved v7.0.11 (#97)
* Downgrade peter-evans/create-pull-request to approved v7.0.11 * Ignore unapproved GitHub Actions versions in dependabot * Rebuild with latest dependencies (#96) Co-authored-by: mraible <17892+mraible@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mraible <17892+mraible@users.noreply.github.com>
1 parent 75c1cc7 commit d6e6a56

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ updates:
2121
time: "14:00"
2222
timezone: "UTC"
2323
ignore:
24+
- dependency-name: "actions/checkout"
25+
versions: [">=6.0.2"]
2426
- dependency-name: "actions/setup-node"
2527
versions: [">=6.2.0"]
2628
- dependency-name: "actions/setup-python"
2729
versions: [">=6.1.0"]
30+
- dependency-name: "peter-evans/create-pull-request"
31+
versions: [">=8.0.0"]

.github/workflows/rebuild.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
git add .
3333
git commit -a -m "Rebuild UI with latest dependencies" || true
3434
- name: Create Pull Request
35-
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
35+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7.0.11
3636
with:
3737
token: ${{ secrets.GITHUB_TOKEN }}
3838
commit-message: 'Rebuild with latest dependencies'

ui/extensions/hello/src/dist/app.js

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,12 @@ var React$1 = /*#__PURE__*/_mergeNamespaces({
590590
default: React
591591
}, [reactExports]);
592592

593+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
594+
595+
function validate(uuid) {
596+
return typeof uuid === 'string' && REGEX.test(uuid);
597+
}
598+
593599
const byteToHex = [];
594600
for (let i = 0; i < 256; ++i) {
595601
byteToHex.push((i + 0x100).toString(16).slice(1));
@@ -632,10 +638,7 @@ function rng() {
632638
const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
633639
var native = { randomUUID };
634640

635-
function v4(options, buf, offset) {
636-
if (native.randomUUID && true && !options) {
637-
return native.randomUUID();
638-
}
641+
function _v4(options, buf, offset) {
639642
options = options || {};
640643
const rnds = options.random ?? options.rng?.() ?? rng();
641644
if (rnds.length < 16) {
@@ -645,6 +648,12 @@ function v4(options, buf, offset) {
645648
rnds[8] = (rnds[8] & 0x3f) | 0x80;
646649
return unsafeStringify(rnds);
647650
}
651+
function v4(options, buf, offset) {
652+
if (native.randomUUID && true && !options) {
653+
return native.randomUUID();
654+
}
655+
return _v4(options);
656+
}
648657

649658
const VERSION = 'current';
650659

@@ -662,6 +671,13 @@ event) {
662671
const CONNECTION_TIMEOUT = 5_000;
663672
const API_TIMEOUT = 30_000;
664673
const NAVIGATION_TIMEOUT = 5_000;
674+
function sanitizeMessageId(messageId) {
675+
// Only allow valid UUID strings
676+
if (typeof messageId !== 'string' || !validate(messageId)) {
677+
return null;
678+
}
679+
return messageId;
680+
}
665681
function timeoutForMessage(message) {
666682
const timeout = message.type === 'connect'
667683
? CONNECTION_TIMEOUT
@@ -753,12 +769,18 @@ class Bridge {
753769
return;
754770
}
755771
const { messageId } = event.data.meta;
756-
const callback = this.pendingMessages.get(messageId);
757-
if (!callback) {
772+
// Sanitize messageId to prevent unvalidated dynamic method calls
773+
const sanitizedMessageId = sanitizeMessageId(messageId);
774+
if (!sanitizedMessageId) {
775+
this.throwError(`Received message with invalid messageId format`);
776+
return;
777+
}
778+
const callback = this.pendingMessages.get(sanitizedMessageId);
779+
if (!callback || typeof callback !== 'function') {
758780
this.throwError(`Received unexpected message`);
759781
return;
760782
}
761-
this.pendingMessages.delete(messageId);
783+
this.pendingMessages.delete(sanitizedMessageId);
762784
callback(message.payload);
763785
};
764786
throwError(message) {

0 commit comments

Comments
 (0)